Common commands:
1. View catalog: LS
LS-A contains hidden directories
Ls-l Show details,-start with file D as directory
Blue for Catalog
Green as an executable file
Black (white): Normal file
2. See Help:
Man command name
Q exit
3. Look at the current directory:
PWD to see under which directory
4. Enter the catalogue
CD Directory Name
Absolute Directory/
Relative directory. Current directory: Parent Directory
5. Go to the Super directory
Root
Operation Files:
1. Build directory: mkdir directory name
2. Copy: CP source (can be absolute, can be relative) target (can be file, can be directory)
Cp-r source (can be absolute, can be relative) the target (can be a file, can be a directory) if not exist then create, if present, go inside the test
3. Move: MV Source target
To delete a folder instance:
Rm-rf/var/log/httpd/access
The/var/log/httpd/access directory and all files and folders under it will be deleted
2
To delete a file usage instance:
Rm-f/var/log/httpd/access.log
This file will be forcibly deleted/var/log/httpd/access.log
VI:
1.VI file name Open this file with VI (open, none created)
2. Writing files
I table inserted in front
A table is inserted at the back
3. Click ESC to exit Edit mode
And then enter the colon
: W Save
: Wq Save Exit
: q! Do not save exit (Force exit)
4.esc, Undo: U
5. Replacement character: R
6. Copy: 1yy 1 Table Copy Row
Copy Multiple lines: 10yy
Cursor moves to the specified line with the keyboard
Point P Key
7. Paste: P
8. Find:/To find the word from the front back N find the next
The words to look for from the back forward
9. Set the line number:
: Set Number
10. Remove the line number:
: Set Nonumber
11. Go to N rows:
: 105
12. Writing Files
echo "Hello,world" > A.txt
13. Append Write:
echo "Hello, World" >> a.txt
14. View Files
Cat A.txt
15. Completely empty the file
Cut the cursor to the last line
Input:
: 1,.D Enter
Linux Common commands