The simple way to restart your CentOS/Linux system is by using the reboot
command.
For more options, check the parameters:
root@web [~]# reboot --help
reboot [OPTIONS...] [ARG]
Reboot the system.
--help Show this help
--halt Halt the machine
-p --poweroff Switch off the machine
--reboot Reboot the machine
-f --force Force immediate halt/power-off/reboot
-w --wtmp-only Don't halt/power-off/reboot, just write wtmp record
-d --no-wtmp Don't write wtmp record
--no-wall Don't send wall message before halt/power-off/reboot
root@web [~]#
You must be logged in as root to shutdown the operating system.
The other command is shutdown
. It’s similar to reboot
.
To reboot the machine with the shutdown
command, use:
shutdown -r now
To reboot the machine at a specific time, use:
shutdown -r 02:30
To reboot the machine after X minutes, use:
shutdown -r X
To shutdown the machine, use:
shutdown -h now
To shutdown the machine at a specific time, use:
shutdown -h 02:30
To shutdown the machine after X minutes, use:
shutdown -h X
For more options, check the parameters for the shutdown
command:
root@web [~]# shutdown --help
shutdown [OPTIONS...] [TIME] [WALL...]
Shut down the system.
--help Show this help
-H --halt Halt the machine
-P --poweroff Power-off the machine
-r --reboot Reboot the machine
-h Equivalent to --poweroff, overridden by --halt
-k Don't halt/power-off/reboot, just send warnings
--no-wall Don't send wall message before halt/power-off/reboot
-c Cancel a pending shutdown
root@web [~]#
For more information use the commands:
man reboot
man shutdown