Ubuntu shutdown, restart, logout command

Source: Internet
Author: User

1 Shutdown Command shutdown

As if the default in Ubuntu terminal is the current user's command, just a normal user, so in the terminal can use SUDO-SH conversion to the administrator root user to execute the command.

1) shutdown–help

You can see how the shutdown command is used, and of course you can use the man shutdown command.

2) Shutdown-h now shuts down immediately

3) Shutdown-r now restarts immediately

4) Shutdown-r +3 three minutes after restart

5) shutdown-h +3 "The System will shutdown after 3 minutes" prompts the user to shut down after three minutes

6) Shutdown-r 20:23 will restart the computer at 20:23

7) Shutdown-r 20:23 & the task of restarting at 20:23 can be placed in the background, the user can continue to operate the terminal

2 Interrupt Command

1) After executing the command (if you do not go to the background), you can use CTRL + C to abort the command

2) Kill program code

When the command is executed in the background, the system returns a program encoding, for example: Using Shutdown-r 20:23 & System return system code: 4905

We can use kill 4905来 to abort the restart command.

3ps aux | grep program number

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

For example, the above program number is 4905, we can use PS aux | grep 4905 can find shutdown-r 20:23 & 's command

halt--the simplest shutdown command

In fact, halt is called shutdown-h. When the halt executes, the application process is killed, the sync system is called, and the kernel is stopped after the file system write operation is complete.

Parameter description:

[-n] prevents the sync system from being called, it is used after patching the root partition with fsck to prevent the kernel from overwriting the patched super block with the old version of the Super Block (superblock).

[-W] is not a real restart or shutdown, just write Wtmp(/var/log/wtmp) records.

[-d] does not write wtmp record (included in option [-n]).

[-f] does not invoke shutdown and forces shutdown or restart.

[-i] before shutting down (or restarting), turn off all network interfaces.

[-p] This option is the default option. is to call Poweroff when shutting down the machine.

Init

Init is the ancestor of all processes, and its process number is always 1, so sending a term signal to init terminates all user processes ﹑ daemons and so on. Shutdown is the use of this mechanism. Init defines 8 runlevel (runlevel) and init 0 shuts down,init 1 for reboot. There is no longer a narrative about Init, which can be lengthy. There are also telinit commands that can change the runlevel of Init, such as,telinit-is, which allows the system to enter single-user mode, and does not get information and wait time when using shutdown.

Logout command to unregister the system

Logout Logoff is the relative operation of the landing, after landing the system, to leave the system, the user can simply release the Logout command:

[[email protected] root] #logout

Red Hat linuxrelease 9 (shike)

Kernel 2.4.20.8 on an i686

Login:← back to the landing screen

Ubuntu shutdown, restart, logout command

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.