Home >Operation and Maintenance >Linux Operation and Maintenance >How to rename files and folders in linux
Linux renaming files and folders can be achieved using the mv command.
mv command:
Linux mv command is used to rename files or directories, or move files or directories to other locations.
Example:
For example: before.txt is the file name before modification, and after.txt is the file name to be modified.
The command is:
mv before.txt after.txt
Note: If there is an after.txt file in the current directory, our file will overwrite it.
The mv command can also move files and folders, for example, move the /a directory to /b and rename it to c.
The command is:
mv /a /b/c
Recommended tutorial: linux tutorial
The above is the detailed content of How to rename files and folders in linux. For more information, please follow other related articles on the PHP Chinese website!