8. Power off restart command
8.1 Power off restart command
(1) Shutdown [option] Time
① Options
- C : Cancels the previous shutdown command
- H: turn off the machine
- R : Restart
Examples of ② applications: #shutdown –h now, Shutdown–h 20:30
(2) Other shutdown commands
①halt②poweroff③init 0
(3) Other restart command :①reboot②init 6
8.2 system Run Level
(1) operating level (can be viewed through Cat/etc/inittab)
Level |
Meaning |
Note |
0 |
Shutdown |
such as Init 0. cannot be set to the default level. |
1 |
Single user (only the root user can log in) |
Only start the core service, generally used for repair operations |
2 |
Not fully multi-user, no NFS service included |
command line mode, no network function |
3 |
Full Multi-user |
Command-line mode |
4 |
Not assigned |
|
5 |
Graphical interface |
Xwindow |
6 |
Restart |
such as Init 6. cannot be set to the default level. |
(2) Modify the system default operating level
#Cat /etc/inittabID:3: initdefault: // set Default level to 3
(3) Check the operating level of the system:
#runlevel // view runlevel: Displayed as n 3 (where n indicates the previous level, here is None, 3 represents the current runlevel)5 /// toggles the run level to 5, which is displayed as 3 5, which represents the previous 3 and is currently 5.
8.3 Exit Login Command
(1) Logout
(2) Ctrl+d
3rd Linux Common Commands (6) _ Shut Down restart command