Mkdir
1. Command format:
mkdir [Options] directory ...
2. Command function:
Create a Directory
3. Command parameters:
-P Create multiple directories
4. Command instance:
Instance 1:mkdir share Creating a directory
Instance 2:mkdir-p share/aa Creating a directory subdirectory
Rm
1. Command format:
RM [Options] Directory ...
2. Command function:
Delete Directory
3. Command parameters:
-RF forcibly deleting a directory (without prompting)
4. Command instance:
Instance 1:RM-RF share Delete a directory
Ls
1. Command format:
ls [options] directory ...
2. Command function:
View Catalog
3. Command parameters:
-A view directory (including. hidden files)
-l list File details
4. Command instance:
Example 1:ls-a share
Example 2:ll-a SHARE/AA
Cat
1. Command format:
ls [options] file ...
2. Command function:
viewing files (file)
3. Command parameters:
-N View file (including display line number)
Omitted..
4. Command instance:
Instance 1:cat-n file View files
Example 2:cat >> 1.txt <<eof
> Content
>eof input content to 1.txt
Cp
1. Command format:
CP [option] Fille file
2. Command function:
Where to copy what?
3. Command parameters:
-P preserves the properties of the source file or directory, including the owner, the owning group, the permissions and the time
-R recursive processing, processing files in the specified directory with subdirectories
4. Command instance:
Example 1:cp-p Share/root/share
Example 2:cp-r Share/aa/root/share
Pwd
1. Command format:
Pwd
2. Command function:
View your current location
3. Command parameters:
No
4. Command instance:
Example 1:pwd shows where you are
Touch
1. Command format:
Touch file
2. Command function:
Create a file
3. Command parameters:
No
4. Command instance:
Example 1:touch 1.txt
Mv
1. Command format:
MV File File
2. Command function:
What to move to where?
3. Command parameters:
No
4. Command instance:
Example 1:mv/root/1.txt/root/share
Head
1. Command format:
Head [options] File
2. Command function:
Show the beginning of file (10 rows by default)
3. Command parameters:
-N Display number of rows
4. Command instance:
Example 1:head-n 5 1.txt showing the first 5 rows
Tail
1. Command format:
Tail file
2. Command function:
Show file's last line (10 rows by default)
3. Command parameters:
-N Display number of rows
4. Command instance:
Example 1:tail-n 5 1.txt display after 5 rows
Find
1. Command format:
Find location [parameter] condition
2. Command function:
Find
3. Command parameters:
-name Search by name
-type Find By Type
-mtime Search by modified time
4. Command instance:
Example 1:find/-type d-mtime 15 | Xargs rm-f Delete directories up to 15 days ago
Instance 1:find/-type f-mtime 15-exec rm {} \; Delete files up to 15 days ago
This article is from "happy spicy small." "blog, declined reprint!"
Common basic commands for Linux