"Linux learning is not difficult" Linux character Interface (2): Shutdown command to shut down and restart the Linux system

Source: Internet
Author: User

3.2 "Linux learning is not difficult" Linux character Interface (2): Shutdown command to shut down and restart the Linux system

The shutdown command can safely shut down or restart the Linux system, and some users will turn off the computer using a direct power-down method, which is very dangerous. Unlike Windows, Linux systems run many processes in the background, so forcing a shutdown can cause data loss to the process, leave the system in an unstable state, and even damage hardware devices in some systems. Using the shutdown command before the system shuts down, the system administrator notifies a warning message to all logged-in users, telling them that the system is about to close and that new users cannot log on again. It is possible to shut down directly or delay a certain amount of time before shutting down, and it may be possible to restart the computer.

The shutdown command also allows the user to specify a time parameter, which can be either an exact time or a time period starting from now. The exact time format is hh:mm, which represents hours and minutes, and the time period is represented by "+" and minutes. After the system executes the command, data synchronization is done automatically.

Command syntax:

shutdown [options] [TIME] [warning message]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-K

Do not execute shutdown, just issue a warning message to all users

-R

Rebooting the system

-H

shutting down the system

-C

Cancel Run shutdown


Example: Shut down the computer system immediately.

[Email protected] ~]# shutdown-h now

Example: Shut down the computer system after 45 minutes of timing.

[Email protected] ~]# shutdown-h +45

Example: Restart the computer system immediately and issue a warning message.

[Email protected] ~]# shutdown-r Now "system would be is reboot now."

Example: Restart the computer system at 1:38.

[Email protected] ~]# shutdown-r 01:38



This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .



Linux learning is not difficult "Linux character Interface (2): Shutdown command to shut down and restart the Linux system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.