Home  >  Article  >  Operation and Maintenance  >  How to rename files or directories in linux

How to rename files or directories in linux

王林
王林Original
2020-10-20 14:36:5013691browse

How to rename files or directories in Linux: You can use the mv command to rename, such as [mv A B], which means renaming directory A to B. At the same time, the mv command can also be used to move files or directories, such as [mv /a /b/c].

How to rename files or directories in linux

To rename files or directories under Linux, you can use the mv command or the rename command. Here we share how to use both.

(Recommended tutorial: linux video tutorial)

The mv command can both rename and move files or folders.

Example: Rename directory A to B

mv A B

Example: Move the /a directory to /b and rename it to c

mv /a /b/c

In fact, it needs to be renamed in text mode To name a file or directory, you only need to use the mv command. For example, if you want to rename a file named abc to 1234:

mv abc 1234

Note, if there is also a file of 1234 in the current directory, this The file will be overwritten.

Related recommendations: linux tutorial

The above is the detailed content of How to rename files or directories 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