English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux mv command (full English spelling: move file) is used to rename files or directories, or to move files or directories to other locations.
mv [options] source dest mv [options] source... directory
Parameter Description:
mv Parameter Settings and Running Results
Command Format | Running Results |
---|---|
mv source_file(file) dest_file(file) | Rename the source file name source_file to the target file name dest_file |
mv source_file(file) dest_directory(directory) | Move the file source_file to the target directory dest_directory |
mv source_directory(directory) dest_directory(directory) | If the directory name dest_directory already exists, move source_directory to the directory name dest_directory; if the directory name dest_directory does not exist, rename source_directory to the directory name dest_directory |
mv source_directory(directory) dest_file(file) | Error |
Rename file aaa to bbb:
mv aaa bbb
Move the info directory into the logs directory. Note that if the logs directory does not exist, the command will rename info to logs.
mv info/ logs
For example, to move /usr/w3codebox Move all files and directories under to the current directory, the command line is:
$ mv /usr/w3codebox/* .