Ubuntu linux shutdown, restart, and logout command (linux) 1 shutdown command it seems that the default command in the ubuntu terminal is the current user's command, just a common user, therefore, you can use sudo-sh in the supervisor to convert it to the administrator root user and execute the command. 1) The shutdown-help command can be used to view how to use the shutdown command. Of course, the man shutdown command can also be used. 2) shutdown-h now shut down now 3) shutdown-r now restart now 4) shutdown-r + 3 restart in 3 minutes 5) shutdown-h + 3 "The System will shutdown after 3 minutes" prompt The user will shut down in three minutes 6) shutdown-r will restart The computer 7) shutdown-r 20:23 & you can put the task restarted at in the background. You can continue to operate Terminal 2 interrupt command 1) After executing the command (if it is not transferred 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 code. For example, when shutdown-r is used, the system returns the system code: 4905 we can use kill 4905 to abort the restart command 3 ps aux | grep program number if we know 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 20:23 & command halt -- the simplest shutdown command in fact, halt is to call 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 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 init running level, such as tel ......