Shutting down and rebooting a Linux system
When it comes to shutting down and rebooting a Linux system the shutdown
command is the only command you need to know to do both jobs
We can use the reboot
and init 6
commands to reboot a system, but the shutdown
offers the sysadmin more flexibility.
The following sections provide examples of using the shutdown
command.
Rebooting a system
- Reboot the system in one minute:
$ sudo shutdown -r
- Reboot the system immediately:
$ sudo shutdown -r now
Shutting down a system
Shutting down your system using the shutdown
command follows the same principle as the above reboot commands.
- Shutdown the system in one minute:
$ sudo shutdown
- Shutdown the system immediately:
$ sudo shutdown now
- Shutdown the system in 1h30m
$ sudo shutdown +90
Cancelling a shutdown or reboot request
If you have executed a delayed shutdown or delayed reboot, you can cancel the request by running:
$ sudo shutdown -c
Note: Using the -c
option to cancel a pending shutdown may be used to cancel the effect of an invocation of shutdown with a time argument that is not "+0" or "now".