Linux shutdown command: shutdown and restart

In the early Linux systems, we should try to use the shutdown command to shut down and restart. Linux because at that time, only the shutdown command before shutdown or restart correctly to abort the process and service, so we always thought shutdown is the safest shutdown and restart commands.

 

In the current system, some other commands (such as a reboot) will abort the process correctly and services, but we still recommend using the shutdown command to shut down and restart.

Basic information of the shutdown command is as follows.

  • Command name: shutdown.
  • English original intent: bring the system down.
  • The path: / sbin / shutdown.
  • Execute permissions: superuser.
  • Description: shutdown and restart

Command Format

[Root @ localhost ~] # shutdown [options] time [warning message]

Options:

  • -c: cancel the shutdown command has been executed;
  • -h: Shutdown;
  • -r: Restart;

[Example 1] reboot and restart the timer.
Let's look at how to use the shutdown command to restart:

[root @ localhost ~] # the shutdown -r now
# reboot, now is now restart the meaning
[root @ localhost ~] # the shutdown -r 05:30
# specified time to restart, but will occupy the front desk terminal
[root @ localhost ~] # -R & lt 05:30 & the shutdown
# define the restart command into the background, the background is the meaning of &
[the root @ localhost ~] # the shutdown -C
// cancel the scheduled restart of
[the root @ localhost ~] # the shutdown -R & lt +10
# 10 minutes after the restart

[Example 2] shutdown and time off.

[root @ localhost ~] # the shutdown -h now
# shutdown now
[root @ localhost ~] # the shutdown -h 05:30
# specified time shutdown

Published 38 original articles · won praise 0 · Views 1212

Guess you like

Origin blog.csdn.net/jiujiudsj/article/details/104170339