Adverts

Cleanly shutting down Debian Linux can be performed in a number of different ways and to some extent depends on whether you are using a graphical user interface (such as KDE or Gnome) or the command line. Performing a clean shutdown is important to maintain the stability of your machine. In the past Linux handled unclean shutdowns quite badly - things are much better now and most applications will restart without problems but that is not an excuse to start just pulling the plug out. The problem with performing an unclean shutdown is that applications don't get a chance to close files they are working on. If one of the files they are working on is critical to the running of the application, such as a settings file, the next time you come to run the application it might fail to start or have broken settngs.

Windowing environments, for instance KDE and Gnome, generally provide a way to shut down and reboot the computer from within the environment. Users of other popular graphical operating systems such as Windows and MacOs will no doubt be familiar with this system. KDE, for instance, pops up a dialog offering the user the option of logging out, shutting down or restarting.

Debian Linux can also be shut down from a command prompt using the command

shutdown

This command can be issued either at a local terminal or remotely using an SSH login (or telnet login if you must). Remote shut down can be useful sometimes - especially it X locks up and freezes the local keyboard.

The shutdown command takes a number of options and can generally only be issued by root although it is possible to configure it so that any user can issue a shut down command. The most commonly used options for shutdown are -r and -h which indicate reboot and halt after shutdown respectively. The shutdown command also requires a time to perform the shut down. This can be an absolute time such as 19:00 or a delay such as 20 minutes you can also use "now" which does exactly what you would expect it to do.

To reboot your computer therefore you would use a command such as this

shutdown -r now

A quick word of warning at this point. If you forget to specify -r or -h your machine will shut down but probably not in the way you expect if you are used to Windows. On Windows a plain shut down means turn off, or halt, the computer. On Linux a plain shut down means switch to run level 0. Run level 0 is where essentially nothing but the kernel is running. If you actually wanted to halt the computer you need to then log in as root and issue a halt command.

If you schedule a shutdown for a future date it can be cancelled with the -c option (to which you don't add a time argument).

Finally, most Debian machines will be configured such that at a command prompt pressing crtl+alt+delete will invoke shutdown and reboot. The man page for shutdown describes how to change this behaviour. Note that crtl+alt+delete won't necessarily work in a windowing environment because X captures all keystrokes and the currently running windowing environment might not map this key combination to shutdown (KDE provides the shut down dialog).

Adverts

Donate and Help

Please support this site and
Bandwidth doesn't grow on trees y' know :o)

Adverts

Get Adsense