Linux shutdown, restart, logout & running Level Analysis 1. shutdown and restart-shutdown Java code shutdown-h now // shutdown immediately-h + 3 // shutdown after 3 minutes-h 20:00 // 00 shutdown-r now // immediately restart shutdown-r + 3 // restart shutdown-r 20:00 // restart shutdown-c // cancel shutdown www.2cto.com 2. shutdown and restart-init Java code init 0 // shutdown init 6 // restart 3. shutdown and restart-telinit Java code telinit 0 // shutdown telinit 6 // restart 4. shutdown-halt Java code halt // pause the system 5. power off-poweroff Java code poweroff // pause the system and try to power off w Ww.2cto.com 6. restart-reboot Java code reboot // pause the system and restart 7. logout-logout Java code logout // log out by the user 8. run-level Java code 0: Shut Down System 1: Single User Mode 2: Non-Network Multi-User Mode 3: multi-user mode with network 4: Keep 5: multi-user mode with network and X Window System 6: restart the System www.2cto.com. The default running level is determined by the id: entry under/etc/inittab. editing this value can change the default running level of the System. Java code grep "^ id:"/etc/inittab id: 5: initdefault: java code runlevel // display the previous and current running level init n // switch the running level telinit n // switch the running level