Shutdown Command in Linux with Examples
shutdown Command
Shutdown command is used to shutdown, restart or reboot the system. This command is used in both local machines and remote machines. And this command needs the root privilege.
Syntax
shutdown < option> < duration> < Task>
Shutting down the system
Now we can see how to shut down in a simple way without using any options.
[root@localhost]# shutdown -h now
-h option is meant for halt which means to stop recursively.
[root@localhost]# shutdown -h +10
" Server is going down 10 minutes from now. Please save your work."
This means that shutdown will be done only after 10 mins.
[root@localhost]# shutdown -r +5
" Server will restart in 5 minutes from now. Please save your work."
This means that system will restart in the given time.
To cancel the shutdown
[root@localhost]# shutdown -c
Power off
The other way to shut down the system is using power off command.
[root@localhost]# poweroff
On running this command it will shut down the system without doing any initial steps (i.e.,) prior precautions, it will pause turn off the system.
Restart command
In every system, if shutdown option is available then there will be restart option for sure.
[root@localhost]# restart The another option for shutdown is [root@localhost]# init 6
Reboot command
Reboot is as same as restart command.
[root@localhost]# reboot
To reboot the machine forcefully
[root@localhost]# reboot -f
-f for forcefully.
Halt command
This command is considered to be the dangerous one. Because while running this command it won’ t ask for any confirmations, it just pause every tasks running in both front and back.
[root@localhost]# halt
The another option for shutdown is
[root@localhost]# init 0
Comments ( 0 )
No comments available