Shutting Down
There are several ways of shutting down the Unix system but which cannot involve switching off the power of the computer. In reality, Unix intensely uses cache memories to accelerate the input or output processes, like several other operating systemstypically with the disks (hard disk, floppy disk...). It can never be ensured which all the data are saved recently are in fact on the disk or not. Therefore the user has to quite the system properly. Below the root command line you have to, type 'init 0', 'halt', 'shutdown' and wait for the computer to print "System Halted" before cutting off the power.
A faster version of the previous solution consists of pressing the ctrl-alt-del keys concurrently. So, the system unmounts all peripherals properly. A user has to wait for the computer to reinitialize and then cut off the power.
The shutdown command, that resides in a directory named /sbin can be used as given below:
# /sbin/shutdown -h now h - To halt the system
Only the root user can issue the shutdown command. To restart a Unix system, an substitute form of the shutdown command has to be used as display below:
# /sbin/shutdown -r now
r - To restart the system
# init 0
# init 6
# halt
# reboot
Although shutting down a system, A Unix automatically logs off all the users which are logged in, terminates all running programs and closes all open files. Under shutting down a system, every virtual console has to be checked to determine if a significant operation is in progress. If so, then the shutting of the system should be delayed until the operation is completed.