Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

9.2. Shutting Down/Rebooting the System

shutdown now

Shutdown the computer immediately (don't power down). Note that in UNIX systems this kind of shutdown means to go to " single-user mode". Single user mode is a mode where only the administrator (root) has access to the computer, this mode is designed for maintenance and is often used for repairs.

For example this would take you to single user mode

shutdown now
shutdown -h now

Shutdown (-h = halt) the computer immediately. It begins the shutdown procedure, press CTRL-C (break-key) to stop it. After the end of the command you can also leave a message in quotation marks which will be broad-casted to all users, for example:

shutdown -h now "Warning system malfunction, self-destruct imminent"

This would halt the system and send the message to anyone who was logged in.

Note you can put a time instead of "now" or "+x minutes" (any number of minutes is appropriate) or you can set an exact time. For example to shutdown at 11:50 type:

shutdown -h 11:50
Note Shutdown -h vs poweroff
 

On some systems, shutdown -h and halt do not actually poweroff the system. On systems that do not power off with these commands use the poweroff command

halt Same as above, doesn't take any options, just shuts down immediately.

shutdown -r now

Shutdown ( -r = reboot) the computer immediately. It begins the reboot procedure, press CTRL-C (break-key) to stop it. After the end of the command you can also leave a message in quotation marks which will be broad-casted to all users, for example:

shutdown -r now "Warning system rebooting, all files will be destroyed"

This would reboot the system and send the message to anyone who was logged in.

Note you can put a time instead of "now" or "+x minutes" (any number of minutes is appropriate) or you can set an exact time. For example to reboot at 11:50 type:

shutdown -r 11:50

reboot Same as above, doesn't take any options, reboots immediately.

CTRL-ALT-DEL

(key-combination) May be used from a terminal to reboot or shutdown, it depends on your system configuration. Note that this doesn't work from an xterminal. CTRL-ALT-DEL begins the reboot/shutdown immediately, the user does not have to be logged in.

Tip You can change the behaviour of CTRL-ALT-DEL from rebooting
 

To disable CTRL-ALT-DEL from rebooting your computer (or to have it do something different), you can edit the /etc/inittab file (as root).

Here is how it looks on a Mandrake/Mandriva Linux system:

# Trap 
CTRL-ALT-DEL


ca::ctrlaltdel:/sbin/shutdown -t3 -r now 


Note that the # means a comment (and is not used). If you simply put a # (hash) before the command it would disable it (it would become a comment).

You could also change the command it runs for example if you changed the -r to a -h the computer would turn off instead of rebooting, or you could have it do anything you want. It's up to your creativity to make it do something interesting.

 
 
  Published under the terms of the GNU General Public License Design by Interspire