Home  >  Article  >  Operation and Maintenance  >  What does mv mean in linux

What does mv mean in linux

藏色散人
藏色散人Original
2023-03-25 09:52:083516browse

mv in linux is a command in linux, used to rename files or directories, or move files or directories to other locations; the syntax of the mv command is "mv [options] source dest mv [options] source... directory".

What does mv mean in linux

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What does mv mean in Linux?

Linux mv command

The Linux mv (full English spelling: move file) command is used to rename a file or directory, or move a file or directory to another location.

Syntax

mv [options] source dest
mv [options] source... directory

Parameter description:

-b: 当目标文件或目录存在时,在执行覆盖前,会为其创建一个备份。
-i: 如果指定移动的源目录或文件与目标的目录或文件同名,则会先询问是否覆盖旧文件,输入 y 表示直接覆盖,输入 n 表示取消该操作。
-f: 如果指定移动的源目录或文件与目标的目录或文件同名,不会询问,直接覆盖旧文件。
-n: 不要覆盖任何已存在的文件或目录。
-u:当源文件比目标文件新或者目标文件不存在时,才执行移动操作。

mv parameter setting and running results

What does mv mean in linux

Example

Rename the file aaa to bbb:

mv aaa bbb

Put the info directory into the logs directory. Note that if the logs directory does not exist, this command will rename info to logs.

mv info/ logs

Another example is to move all files and directories under /usr/runoob to the current directory. The command line is:

$ mv /usr/runoob/*  .

Recommended learning: "linux video tutorial"

The above is the detailed content of What does mv mean in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is linux bindNext article:what is linux bind