This article takes CentOS7
this as an example.
Directory structure of this article
1 Login and logout
1.1 Login
- Linux is a multi-user and multi-tasking operating system, and then use *system administrator** to configure the account to enter the system.
- When logging in, try to log in with the root account as little as possible to avoid misoperations with excessive permissions.
- If you need
root
permissions, you can log in as a normal user and then usesu- 用户名
the command to switch to the system administrator identity.
1.2 Log out user
logout
- Note: This command is not valid at the graphics run level and is valid at run level 3 .
2 Shut down and restart
2.1 Shut down immediately
shutdown -h now
Shut down after 2.2 N minutes
shutdown -h [N]
2.3 Restart the computer immediately
shutdown -r now
- Among them:
h
Representativehalt
r
Representativereboot
2.4 Shutdown
halt
2.5 Restart the computer immediately
reboot
2.6 Synchronize memory data to hard disk
sync
2.7 Special attention
- When restarting or shutting down the system, the command is first executed
sync
to write the memory data to the disk to prevent the loss of important data.