Although it's not often necessary, you may find a reason to occasionally restart or shut down your server. Table A.15 contains these commands.
COMMAND
GENERAL USAGE
DESCRIPTION
halt
Shuts down the computer.
init
init [RUNLEVEL]
Changes the current runlevel to the specified runlevel.
Possible runlevels are
0
System halt
1,S,s
Single-user mode
2
Local multiuser, minimal networking
3
Full multiuser with networking
4
Not used
5
Full multiuser with networking and graphical environment
6
System reboot
reboot
Restarts the computer.
runlevel
Displays previous and current runlevel. (If the previous runlevel is N, runlevel has not been switched since startup.)
shutdown
shutdown [OPTIONS] time
Used to shut down or restart a Linux machine.
Common options include
-h Halt, or shut down computer
-r Reboot computer
For example:
shutdown -h now