In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the usage of Linux basic command shutdown". In daily operation, I believe many people have doubts about the usage of Linux basic command shutdown. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the usage of Linux basic command shutdown"! Next, please follow the editor to study!
Shutdown
The shutdown command shuts down the system in a secure manner, and all users who have logged in will be told that the system is about to shut down. And in the last five minutes, new logins will be blocked. After the specified time, the gateway sends a request to the init (8) daemon to bring the system down to the appropriate runlevel. This is done by issuing the runlevel (7) event, which includes the new runlevel in the RUNLEVEL environment variable and the previous runlevel in the PREVLEVEL variable (obtained from the environment or / var/run/utmp). You can set an additional INIT_HART variable that will contain the Hall value of shutting down using the halt instruction, or the power off value of shutting down using the power off instruction.
The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1. Grammar
Shutdown [option] [time] [warning]
2. List of options
Option
Description
-c
Cancel the shutdown in progress. This option has no time parameter.
-h
Turn off the computer, which is equal to halt or power off
-P
Equivalent power off
-H
Equivalent halt
-k
Just issued a warning message, logged out, and did not turn off the computer.
-r
Restart, equal to reboot
time
Now means to shut down immediately; + m means to shut down after m minutes; 23:00 means to shut down at 11:00 in the evening
3. Description
If set to preferred to read RUNLEVEL from / var/run/utmp, shutdown will read the current runlevel from this environment variable. / var/run/utmp file, read the location of the current runlevel, the file will also be updated with the new runlevel. / var/log/wtmp file, the new runlevel record will be appended to this file. The Upstart init (8) daemon does not track the runtime itself, but is implemented entirely by its user-space tools.
4. Examples
1) shut down the machine after 5 minutes and issue a warning "I am downing"
[root@192 /] # shutdown-h + 5 I am downing / / the current operation is issued by a root user, and the computer shuts down after 5 minutes, and there is a prompt.
Broadcast message from root@192.168.0.113
(/ dev/pts/1) at 10:40.
The system is going down for halt in 5 minutes! / / 5 minutes
I am downing / / Custom prompt messages
[weijie@192 root] $/ / the current console is logged in by the weijie user, who also received the shutdown message
Broadcast message from root@192.168.0.113
(/ dev/pts/1) at 10:40.
The system is going down for halt in 5 minutes!
I am downing
2) cancel the shutdown
[root@192 ~] # shutdown-c / / you need to open another terminal and enter the cancel command
[root@192 /] # shutdown-h + 5 I am downing / / in the previous shutdown command window, you can finally see the cancellation message.
...
The system is going down for halt in 4 minutes!
I am downing
Shutdown: Shutdown cancelled
[root@192 /] #
At this point, the study of "the usage of the Linux basic command shutdown" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.