Linux Move Files and Folders (Directories) Commands

Command mv English move translation The mobile
mv command can move files or folders (directories), and can also reorder (overwrite) files.
1. Move file/rename
Simply move a file and use directly:

mv <源文件名称/地址> <新文件名称/地址>

This method can also be used to modify the name of the file.
2. Move the contents of a folder (directory)
If you want to move the contents of a folder

some content:

mv <源目录地址/###> <新目录地址>

to remove ### content
all content:

mv <源目录地址/*> <新目录地址> ,或者直接使用
mv <源目录地址/> <新目录地址>

* is a wildcard,
you can move all the content under the address of the source directory
and all the content with the .txt suffix:

mv <源目录地址/*.txt> <新目录地址>

, you can remove all TXT documents
3. Move the folder (directory) and the content under the folder
If you want to move the content of the folder and the folder itself:

mv <源目录地址 > <新目录地址/>

, that is, add / after the folder directory address!

Guess you like

Origin blog.csdn.net/weixin_44229976/article/details/130124197