Nine, move, rename files
MV Moving Files
Format: mv+ source file + target
-I Interactive, pre- overwrite hints
-F forced override
rm Delete files and directories
- I. Interactive
-F Mandatory
-R Recursive Delete directory common commands rm-rf
Rename changing file names in bulk with string substitution (wildcard characters are supported)
Format: rename+ original string + target string + file list to change filename
Example: Rename. txt. doc *.txt
X. Directory Operations
mkdir Create a directory
- p recursive creation of multi-level directories, if the directory to be set up in the upper directory is not yet established, will be set up the upper directory
- v Show details when creating a directory
- m + target attribute set permissions directly when creating directory
rmdir Delete only empty directories
- p recursive delete multilevel empty directory
- v Displays the details of the deletion
case
(1) How to create/testdir/dir1/x,/testdir/dir1/y,/testdir/dir1/x/a,/testdir/dir1/x/b,/testdir/dir1/y/a,/testdir/dir 1/y/b
mkdir-p/testdir/dir1/{x/{a,b},y/{a,b}}
(2) How to create/testdir/dir2/x,/testdir/dir2/y,/testdir/dir2/x/a,/testdir/dir2/x/b
mkdir-p/testdir/dir2/{x/{a,b},y}
Finally, you can view the created directory with the tree command
Linux Learning-File management (2)