The ‘shutdown’ command brings the system down in a secure and planned manner. By default, running this command with no options will bring the system to a single user mode. However, options can be used with this command to halt or reboot the system. Take some examples as follows:

linux:/ # shutdown -r now

The ‘r’ option is used to reboot the system and ‘now’ keyword tells the system to reboot immediately.

linux:/ # shutdown -r +5 System maintenance is required

The above command will reboot the system after 5 minutes and it will send a message ‘System maintenance is required’ to all the active users at the time of command execution. Please note that after the command execution, no new users will be allowed to login the system since it is getting restarted.

linux:/ # shutdown –h 13:59

The ‘h’ option is used to halt the system. The above command will shutdown and halt the system at 13:59 hours.

You can also restart the system in a specific init level by using this command with ‘i’ option as shown below:

linux:/ #shutdown  –y  -g0  –i5

The above command will immediately shutdown and power off the system. ‘y’ is used to specify yes to any confirmation message and ‘g’ specifies a grace period before shutdown.Similarly, the following command will restart the system immediately.

linux:/ # shutdown -i6 -g0 -y

Adnan Khurshid

Adnan Khurshid, the author of this article, has been working in a telecommunication sector since 2007. He has worked there as a VAS (Value Added Services) engineer and has excelled remarkably in the field. Working in this field has been his passion and he has always made efforts to keep himself up to date. Find more about him on LinkedIn

More Posts

Tags: ,

Leave a Reply