Linux instruction Learning shutdown, logoff and restart __linux

Source: Internet
Author: User
1 Shutdown Command shutdown

As if the default in Ubuntu's terminal is the current user's command, just a regular user, so you can use Sudo-sh in the terminal to execute commands under administrator root.

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 shut down immediately

3) Shutdown-r now reboot immediately

4) Shutdown-r +3 three minutes after reboot

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

6) Shutdown-r 20:23 Restart the computer at 20:23

7 Shutdown-r 20:23 & can be restarted at 20:23 to the background, users can continue to operate the terminal

2 Interrupt Command

1 after the execution of the command (if 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 the Shutdown-r 20:23 & System return system code: 4905

We can abort the reboot command using the kill 4905来.

3ps aux | grep program number

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

For example, the above program number is 4905, we can use PS aux | grep 4905 will be able to find the Shutdown-r 20:23 & command.

halt--the simplest shutdown command

In fact, halt is called shutdown-h. Halt executes, kills the application process, performs the sync system call, and stops the kernel after the file system write operation completes.

Parameter description:

[-n] Prevents sync system calls, which are used after patching the root partition with fsck to prevent the kernel from overwriting the patched super blocks with the old version of the Super Block (superblock).

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

[-d] does not write Wtmp records (already included in options [-n]).

[-f] forced shutdown or reboot without invoking shutdown.

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

[-p] This option is the default option. is to call Poweroff when shutdown.

Init

Init is the ancestor of all processes, and its process number is always 1, so sending term signals to init terminates all user processes ﹑ daemons, and so on. Shutdown is the use of this mechanism. Init defines 8 run levels (runlevel), Init 0 for shutdown,init 1 for reboot. There is no longer a narrative about init that can be lengthy. There are also telinit commands that can change the running level of init, such as,telinit-is, which allows the system to enter Single-user mode, and does not have the information and latency to use shutdown.

Unregister the system's logout command

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

[Root@localhost Root] #logout

Red Hat linuxrelease 9 (shike)

Kernel 2.4.20.8 on a i686

Login:← back to the landing 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.