(1) Listing files: LS
-a displays all files and directories, including hidden files
-L Display detailed information (long format display)
-D Displays the directory itself
-H humanized Display
-I view I node
(2) Create directory: mkdir
-P Recursive creation
multiple, mkdir AA bb cc can be created at the same time
(3) Switch directory: CD
. Go to current directory
.. Go to Parent Directory
(4) Display the current directory absolute path: pwd
(5) Delete empty directory: RmDir
(6) Copy: CP
-R Copy Directory
-P Preserve Original file attributes
Multiple CP A.txt can be duplicated simultaneously b.txt/tmp/cc
(7) Cut renaming: MV
Multiple MV A.txt can be cut simultaneously b.txt/tmp/cc
(8) Delete: RM
-R Delete Directory
-F Direct Delete, no hint
Example: Rm-rf install.log
(9) Create an empty file: Touch
(10) Browse file contents: Cat
-N Display Line number
Reverse, TAC
Example: Cat Install.log
(11) Paging Display file contents: more
Space page
Carriage return line break
Q exit
Example: More Install.log
(12) Paging displays the contents of the file: less to page up
Space page
Carriage return line break
Q exit
PageUp PAGE Up
Up ARROW upside down line
/keyword search keywords
N Next key word
Example: Less Install.log
(13) Display the first few lines of the file: Head
-n Specifies the number of rows
The first 10 rows are displayed by default
Example: Head-n 7 Install.log
(14) A few lines after displaying the file: Tail
-n Specifies the number of rows
-F Dynamic display of file end content
Example: TAIL-FN 7 Install.log
(15) Generate Link file: ln
-S Soft Connect
Generate Hard Links by default
Difference:
Soft Connect is just a shortcut, delete source file link is invalid
Hard links are common to one I node, delete does not affect others, cannot span partitions, cannot point to directories
Example: Ln-s/root/install.log a.txt
Linux notes (i)-Directory processing commands