Home  >  Article  >  System Tutorial  >  Shutdown command format of CentOS shutdown method

Shutdown command format of CentOS shutdown method

WBOY
WBOYforward
2024-01-07 20:34:111007browse
Introduction The system administrator will notify all logged-in users that the system will be shut down, and new users will no longer be able to log in. By executing the parameter shutdown command, you can directly shut down the Linux host or shut down the host after a specified time, or perform a shutdown operation and then restart the host. During this process, programs such as vi and mail run by other users can have time to save the document being edited and exit normally.

The shutdown command sends a signal to the init program, asking it to change the system run level runlevel to 0. The shutdown command can complete the following operations:

    1. Shutdown mode selection: Shut down or restart.
    2. Shutdown time selection: You can specify to shut down immediately or at a specific time.
    3. Shutdown alarm information: Before shutting down, the specified information can be sent to the logged-in user.
    4. Only display warning information: In some cases, some system maintenance or update operations need to be performed. During this period, you do not want other users to log in to the system to avoid data loss or other problems. In this case, you can use the shutdown command with appropriate parameters. to notify other users, but does not actually shut down the system.

So how to use the shutdown command? Should I execute shutdown directly or do I need to add parameters before executing it? "Man" anytime and anywhere is a good habit for learning Linux. You can also use shutdown --help to view how to use the command. In comparison, man shutdown returns a more detailed command explanation.

Shutdown command format of CentOS shutdown method

The simple syntax rules of the shutdown command are:

shutdown [-krhc] [时间] [警告信息内容]
    Parameter Description:
  • -k: It is not really a shutdown, it only sends a warning message to the logged in user
  • -r: Restart the system immediately after shutting down all services in the system
  • -h: After shutting down all services in the system, shut down immediately.
  • -c: Cancel the shutdown command operation that is already in progress.
  • Time: Specify the time for system shutdown! Without this parameter, the system automatically performs the shutdown operation after 1 minute by default.

Shutdown command format of CentOS shutdown method

The above is the detailed content of Shutdown command format of CentOS shutdown method. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete