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

How to rename files and folders in linux

王林
王林 Original
2020-05-25 14:08:50 12991browse

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!

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