Commands for Ubuntu shutdown, restart, and logout are not described in detail.

Source: Internet
Author: User

1 shutdown command

It seems that the commands of the current user are the default commands of ubuntu, but they are common users. Therefore, you can use Sudo-SH in the supervisor to convert them to the administrator root user and execute the commands.

1) shutdown -- Help

You can view how to use the shutdown command, or use the man shutdown command.

2) shutdown-H now shut down immediately

3) shutdown-R now restart now

4) shutdown-R + 3 restart after three minutes

5) shutdown-H + 3 "The system will shutdown after 3 minutes" prompt that the user will shut down in three minutes

6) shutdown-R will restart the computer

7) shutdown-R & you can put the task restarted at in the background. You can continue to operate the terminal.

2. Interrupt command

1) After the command is executed (if it is not transferred to the background), you can use Ctrl + C to stop the command.

2) KillProgramEncoding

When the command is executed in the background, the system returns a program code. For example, when shutdown-R is used, the system returns the code 4905.

We can use kill 4905 to stop the restart command.

3 Ps aux | grep program No.

If we know the program number, we can use PS aux | grep program number to query the command corresponding to the program number.

For example, if the program number is 4905, we can use PS aux | grep 4905 to check the shutdown-R & command.

Halt-the simplest shutdown command
In fact, halt calls shutdown-H. When halt is executed, the application process is killed and the sync system call is executed. After the file system write operation is completed, the kernel is stopped.
Parameter description:
[-N] prevents the sync system from calling. It is used to fix the root partition with fsck to prevent the kernel from overwriting the repaired super block with the old version of superblock.
[-W] is not a real restart or shutdown, but a record for wtmp (/var/log/wtmp.
[-D] Do not write the wtmp record [included in Option [-N 〕.
[-F] Force shutdown or restart without calling shutdown.
[-I] disable all network interfaces before shutting down (or restarting.
[-P] this option is the default option. It is called poweroff when shutdown.

Init
Init is the ancestor of all processes, and its Process number is always 1. Therefore, sending a term signal to init will terminate all user processes and daemon processes. Shutdown uses this mechanism. Init defines eight runlevels. init 0 indicates shutdown, and init 1 indicates restart. I will not describe it here for a long article on init. In addition, the telinit command can change the running level of init. For example, telinit-Is can enable the system to enter the single-user mode, and the information and waiting time when shutdown is not available.

Log out of the system's logout command

Logout is a relative logon operation. to exit the system after logging on to the system, you only need to directly issue the logout command:

[Root @ localhost root] # logout

Red Hat linuxrelease 9 (shike)

Kernel 2.4.20.8 on an i686

Login: logging back to the login screen

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.