File directory
- USR: related to software Installation
- VAR: system Run Process related
- Bin: Executable file
- Boot: System Boot related directory
- Dev: Drive Directory
- Home: Store user's individual user files
- Lib:linux function Library
- Media: can delete devices
- MNT: Media-like
- OPT: third-party software storage Directory
- Root: Administrator Directory
- Sbin: Administrator executable file
- Temp: Temporary files that need to be deleted periodically
- Proc: Virtual File system
- SYS: Virtual file system, kernel module
- ETC: Store the user group file "group", User information file ' passwd
Common commands
-
View Ip: ip Addr
-
View information ls
-
View more information ll or ls-l
-
View hidden files Ls-al
-
Create a folder (you can fill in the path, but the path must exist) mkdir <name>
-
Create file (path does not exist, create path automatically) Mkdir-p <name>
-
Safe deletion (only empty directories can be deleted or error) RmDir <name>
-
Delete Rm-rf <name>
-
Create File VI <name>
-
Save File Press ESC, enter: q / exit or wq / Save and exit
-
Edit press I--press ESC--q! / Force quit or wq / save and exit
-
The arrow keys in the file h / left, k /, j /, l / right
-
Fast Move cursor number key + arrow key
-
Page DOWN Ctrl + f
-
Page UP Ctrl + b
-
Turn up half a page ctrl + u
-
Turn down half a page ctrl + d
-
Move to end of line end or $
-
Move to the wardrobe home or 0
-
Move to the end of Wen Shift + g
-
Move to the beginning G + g
-
How many rows of numbers to move backwards + shift + g
-
Querying the command line / + query criteria
-
Query up the command line? + Query criteria
-
Delete Files Rm-f <name>
-
10 lines after viewing the file tail <name>
-
20 lines after viewing the file tail-20 <name>
-
Float, change the contents of the file, print out the changes tail-f <name>
-
Print file contents Cat <name>
-
filtering, finding grep <name>
-
ll | grep txt file in ‘txt’ folder
-
User actions
- User must belong to a user group, you add a user, the system will automatically help you create a user group
- Add user Information Useradd <name>
- Print user Information cat/etc/passwd
Printed information cc:x: 1000:1000::/home/cc:/bin/bash
Directory for user name, password, user ID, user group ID, notes, user directory, Shell command, respectively
4. Add a password to the user passwd <name>
5. Remotely connect a computer SSH < user name >@ address
6. View user Groups Cat/etc/group
7. Create user group Groupadd < user group name >
8. Add user to User group Useradd-g < user group > < user name >
9. Delete user groups Groupdel < user groups >
However, the user primary group cannot be deleted, the user primary group is a user group with the same name as the user name, you can change
10. Delete User Userdel < user name >
11. See which user group the user belongs to, group < user name >
Direct write group, is to view the current user group
12. Modify user Primary group Usermod-g < user group > < user name >
13. View the user's details ID < user name >
14. Switch User Su < username >
15. Exit the user exit
Background operation
- View Machine Type Lscpu
- View disk full space DF
- View disk space df-h
- View index Space Df-i
- View current running program PS aux
- To see if the program is running PS aux |grep < user name >
- View top of a computer's resource footprint
- Exit Ctrl C
- If you cannot connect to the server, you need to turn off the firewall
Systemctl Disable FIREWALLD
Reboot
All interfaces on Linux are in the form of files
Linux/centos Basic Operation