Home >Operation and Maintenance >Linux Operation and Maintenance >How to rename files or directories in linux
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].
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!