I. Directory management commands (mkdir, rmdir
The types of Linux files are:-: ordinary file case; d: directory file; b: block device file; C: Character device file; l: Link file; s: Socket file; p: Pipe file.
1. mkdir: Create directory (used for path base name, path name must exist before path base name)
mkdir [OPTION] ... DIRECTORY ...
OPTION:
-P: When creating a directory, the path name is created if the path before the base name of the path does not exist.
-V: Displays the process of creating the directory. Verbose
-M Mode: Set directory permissions when creating a directory, or default if the parameter mode is not given.
Extension 1: Create/tmp/x/y1,/tmp/x/y2,/tmp/x/y1/a,/tmp/x/y1/b
Method One: #mkdir/tmp/x/y1/tmp/x/y2/tmp/x/y1/a/tmp/x/y1/b-PV
Method Two: Use the command line to expand the mechanism:
[Email protected] tmp]# Mkdir/tmp/x/{y1/{a,b},y2}-PV
mkdir: The directory "/tmp/x" has been created
mkdir: The directory "/tmp/x/y1" has been created
mkdir: The directory "/tmp/x/y1/a" has been created
mkdir: The directory "/tmp/x/y1/b" has been created
mkdir: The directory "/tmp/x/y2" has been created
[Email protected] tmp]#
[[Email protected] tmp]# tree x//directory structure for viewing directory X
X
|--Y1
| |--A
| '--B
'--y2
Extension 2: Creating A_c,a_d,b_c,b_d
-
[[email protected] tmp]# mkdir./x/{a,b}_{c,d}//polynomial multiplication.
-
[[email protected] tmp]# Mkdir-pv/tmp/x/{a_{c,d},b_{c,d}}
Extension 3:
2, RmDir: Delete directory: (only to delete empty directory, and there is no option to force deletion)
rmdir [OPTION] ... DIRECTORY ...
OPTION
-P: When a directory is deleted, it is deleted if its parent directory is empty.
-V: Show removal process
Linux Directory Operations Command