In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use shutdown to set shutdown in linux". In daily operation, I believe many people have doubts about how to set shutdown with shutdown in linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use shutdown to set shutdown in linux". Next, please follow the editor to study!
Methods: 1, "shutdown-s-t seconds" timing shutdown; 2, "shutdown-p" or "shutdown-s-t 0" command immediately shutdown; 3, "shutdown-r-t seconds" timing restart; 4, "shutdown-h" setting dormancy.
The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.
Cmd shutdown command: shut down, restart, hibernate
Turn off the phone after a period of time:
The effect of shutdown-s-t seconds is to turn off the computer after counting down to that number of seconds. For example, shutdown-s-t 3600 shuts down after 3600 seconds, that is, it shuts down after an hour.
Immediate shutdown command:
Shutdown-p shuts down the local computer with the effect of shutting down immediately without a countdown
You can also use shutdown-s-t 0 to set the shutdown after 0 seconds, which means to shut down immediately.
Restart after a period of time
The number of shutdown-r-t seconds. The effect is to restart after the countdown to this second. For example, shutdown-r-t 0 is restarted after 0 seconds, which means restart immediately. If you do not add the-t parameter, the computer will be shut down after the default seconds, usually one minute.
Dormancy command
Shutdown-h, this instruction hibernates the computer, that is, completely shuts down the power, but saves the current state of the computer, and the next time it starts, these opened programs are still there. A suspend function similar to that of a virtual machine.
Show shutdown command syntax
Encounter orders do not understand, generally go to the Internet search, but I found that the information on the Internet are all introduced, in fact, the most should be done directly in the cmd view, the official introduction document.
Enter shutdown-help to display the usage of the shutdown instruction
Usage:
Shutdown [/ I | / l | / s | / sg | / r | / g | a | / p | / h | / e | / o] [/ hybrid] [/ soft] [/ fw] [/ m\\ computer] [/ t xxx] [/ d [p | u:] xx:yy [/ c "comment"] does not have parameters to display help. This has to do with typing /? It's the same. /? Show help. This is the same as not typing any options. / I display graphical user interface (GUI). This must be the first option. / l log out. This cannot be used with the / m or / d options. / s turn off the computer. / sg turn off the computer. Restart any registered applications the next time you start. / r shut down and restart the computer completely. / g shut down and restart the computer completely. Restart any registered applications after rebooting the system. / an abort system shutdown. This can only be used during the timeout period. Used in conjunction with / fw to clear any outstanding boot to firmware. / p shut down the local computer with no timeout or warning. Can be used with the / d and / f options. / h hibernate the local computer. Can be used with the / f option. / hybrid performs computer shutdown and prepares for quick startup. Must be used with the / s option. / fw is used in conjunction with the off option to redirect the next boot to the firmware user interface. / e record the reason why the computer shuts down unexpectedly. / o go to the Advanced Startup options menu and restart your computer. Must be used with the / r option. / m\\ computer specifies the target computer. / t xxx sets the timeout before shutting down to xxx seconds. The valid range is 0-315360000 (10 years) and the default value is 30. If the timeout is greater than 0, it is implied as the / f parameter. / c "comment" comments on the reasons for restarting or shutting down. A maximum of 512 characters are allowed. / f forces the running application to be closed without warning the user. If you specify a value greater than 0 for the / t parameter, it is implied as the / f parameter. / d [p | u:] xx:yy provides reasons for restarting or shutting down. P indicates that the restart or shutdown is planned. U indicates that the reason is user-defined. If neither p nor u is specified, the restart or shutdown is unplanned. Xx is the primary cause number (a positive integer less than 256). Yy is the secondary reason number (a positive integer less than 65536).
Reasons on this computer:
(e = expected U = unexpected P = planned, C = custom)
Category main minor title U 0 0 other (unplanned) E 0 0 other (unplanned) E P 0 0 other (planned) U 0 5 other failures: system does not respond E 1 1 hardware: maintenance (unplanned) E P 1 1 hardware: maintenance (planned) E 1 2 hardware: install (unplanned) E P 12 hardware: install (planned) E 2 operating system: restore (unplanned) E P 2 operating system: restore (planned) P 2 3 operating system: upgrade (planned) E 24 operating system: reconfigure (unplanned) E P 24 operating system: reconfigure (planned) P 216 operating system: Service Pack (planned) 2 17 operating system: hotfix ( Unplanned) P 2 17 operating system: hotpatch (planned) 2 18 operating system: security patch (unplanned) P 218 operating system: security patch (planned) E 4 1 Application: maintenance (unplanned) E P 4 1 Application: maintenance (planned) E P 4 2 Application: install (planned) E 4 5 Application: no response E 4 6 Application: unstable U 5 15 system failure: stop error U 5 19 Security issues (count ) E 5 19 Security issues (unplanned) E P 5 19 Security issues (planned) E 5 20 Network connection lost (unplanned) U 6 11 Power failure: unplugged U 6 12 Power failure: environment P 7 0 Legacy API shutdown
As can be seen from the help documentation
Shutdown-h means to hibernate the local computer, and the computer will hibernate immediately after executing the instruction. The-h parameter can be used with the-f parameter, but not with the-t parameter. In other words, the usage of shutdown-h-t 3600 is wrong.
Shutdown-p shuts down the local computer, which shuts down immediately after executing the instruction, and does not wait for the default time.
Shutdown-s means to shut down the local computer. If the-t parameter is not used, the computer will be shut down after the default event. If the-t parameter is used, the machine will be shut down after the countdown to the set time. For example, shutdown-s-t 3600 will shut down after 3600 seconds.
Shutdown-r means to shut down and restart the computer completely. It can be understood as a restart. Similarly, you can add-t to set the countdown time before restarting. For example, shutdown-r-t 3600 restarts after a countdown of 3600 seconds, while shutdown-r-t 0 restarts immediately after a countdown of 0 seconds.
Shutdown-a means cancel shutdown or cancel reboot. Execute shutdown-a before the end of the shutdown-s or shutdown-r countdown to cancel the shutdown or restart operation.
At this point, the study on "how to set the shutdown with shutdown in linux" 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.