Does Linux have a Ctrl+Alt+Del equivalent?

19

5

Does Linux have a CTRL+ALT+DEL equivalent?

gutsygecko

Posted 2010-09-28T13:51:42.043

Reputation: 191

3CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager? – BloodPhilia – 2010-09-28T14:00:22.503

This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use? – Daenyth – 2010-09-28T14:19:05.733

Answers

17

X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.

Thariama

Posted 2010-09-28T13:51:42.043

Reputation: 762

1Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode. – Eroen – 2012-03-30T15:44:56.090

9

Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab where you should be able to read a line like:

<id>::ctrlaltdel:/sbin/shutdown -t3 -r now

(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:

<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich

(which is much more useful :)

Kevin

Posted 2010-09-28T13:51:42.043

Reputation: 334

1@Eroen /usb/bin/sudo file not found. – ctrl-alt-delor – 2020-02-01T22:17:27.780

4make: *** No rule to make target `me'. Stop. – Eroen – 2012-03-30T15:47:05.497

7

Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.

Holding down Alt and SysRq (which is the Print Screen key) and typing REISUB with a few(I usually count to 5) seconds between each key will get you safely restarted. REISUO will do a shutdown rather than a restart. As pointed out by a comment, this is not a single command, but a combination of many commands, each doing a specific thing. So I recommend to take a look at REISUB - the gentle Linux restart for more details.

And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.

Thomas

Posted 2010-09-28T13:51:42.043

Reputation: 397

1Downvoted. Define "slowly", or explain what reisub really does. This is not a single command, but a combination of 6 commands, each of them doing something specific (look up the Wikipedia article on magic SysRq key for details). So if you hit i too quickly after e, you can kill the programs while they're still shutting down - like I did after reading this answer. – Przemek D – 2019-03-22T17:02:48.400

Edited the answer, hope this clarifies the confusion. – Thomas – 2019-03-25T11:13:14.183

2

In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.

In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).

florin

Posted 2010-09-28T13:51:42.043

Reputation: 1 261

The second part is simply false. Killing the X server will immediately terminate the active session, and all active programs with it. This is nowhere near what ctrl+alt+del does in Windows. – Przemek D – 2019-03-25T10:59:13.807

2

Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.

xdevel2000

Posted 2010-09-28T13:51:42.043

Reputation: 159

1

REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.

For a Program Manager-like interface, use top and hit 'k' for 'k'ill.

Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.

James Broadhead

Posted 2010-09-28T13:51:42.043

Reputation: 179

+1 for magic SysRq-keys. They have been handy many times in the past. – Daniel Andersson – 2012-03-30T17:50:42.990

0

The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del

Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.

The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:

  • reboot immediately
  • send SIGINT to the init process

Which behavior is used can be selected with either:

  • reboot system call, see man 2 reboot
  • /proc/sys/kernel/ctrl-alt-del

For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab as:

::ctrlaltdel:/sbin/reboot

And here is a minimal interesting C example for uclibc:

#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>

void signal_handler(int sig) {
    write(STDOUT_FILENO, "cad\n", 4);
    signal(sig, signal_handler);
}

int main(void) {
    int i = 0;
    /* Disable the forced reboot, enable sending SIGINT to init. */
    reboot(RB_DISABLE_CAD);
    signal(SIGINT, signal_handler);
    while (1) {
        sleep(1);
        printf("%d\n", i);
        i++;
    }
    return EXIT_SUCCESS;
}

Here is an easy setup to try this out.

Ciro Santilli 新疆改造中心法轮功六四事件

Posted 2010-09-28T13:51:42.043

Reputation: 5 621

0

Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.

karlphillip

Posted 2010-09-28T13:51:42.043

Reputation: 971

That's not true. This will mostly reboot the window manager, not open up a task manager. – slhck – 2012-07-18T00:50:12.150

0

In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.

The process manager for Gnome is called gnome-system-monitor, so if you go to: - System; - Preferences; - Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)

Azz

Posted 2010-09-28T13:51:42.043

Reputation: 3 777