Common Linux Command shortcuts and linux shortcuts
Auxiliary operations for command line editing:
Tab key: auto-completion
Ctrl + U: clear to the first line
Ctrl + K: clear to the end
Ctrl + L :( or clear) clear Screen
Ctrl + C: cancel the command
Command for getting help:
Internal Command help example: help cd
Most external commands -- help
Use man command to read the manual
Read the manual using the info command
Directory operation command:
Pwd: used to view the working directory
Cd: used to switch the working directory, for example, cd (working directory location)
Ls :( List) display directory content such as: ls (option), (file or directory)
Mkdir: Create a new directory.
Du: Statistics on the space usage of directories and files (-h is displayed in a more readable byte k m format, and-s only calculates the space occupied by each parameter)
File Operation command:
Touch: Create an empty file
File: view the file type
Cp :( copy) copy a file or directory cp [Option] source file or directory
(-R) recursively copy the entire directory tree
Rm :( remove) delete a file or directory
Mv: (move) move a file or directory
File Content operation command:
Cat:Show all file content
Head: view the content at the beginning of the file (head-n rows of file names)
Tail: view the end content of the file (tail-n file name)
Vi Editor Working Mode:
File directory permission:
1. Permission type
Read r 4
Write w 2
Execute x 1
No permission-0
2. View File Permissions
Ls-lh
-Rw-r -- 1 soft01 soft01 30 Aug 17 10:39 itany.txt
Drwxrwxr-x 5 soft01 soft01 4.0 K June 16 09:28 movie
-Rw-r --
D rwx r-x
The first part indicates the file type.
The second part indicates the permissions of the owner.
Part 3: Group Permissions
Part 4 indicates the permissions of others
3. Modify permissions
There are two methods to use the chmod command:
A. Statement 1
Chmod [ugoa] [+-=] [rwx] File
Chmod o-r itany.txt
Chmod g = r itany.txt
Chmod o + rw itany.txt
B. Statement 2
Chmod nnn File
Set the owner to read only, the Group to read and write, and others to read only
Chmod u = r itany.txt
Chmod g = rw itany.txt
Chmod o = r itany.txt
Chmod u = r, g = rw, o = r itany.txt
Chmod 464 wbs17061.txt
Chmod 777 itany.txt
View Network Information:
IfcoNfig: View IP addresses
Ping: test network conditions
Netstat: view the network connection status