How to rename files or directories in linux

王林
Release: 2020-10-20 14:36:50
Original
13632 people have browsed it

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
Copy after login

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

mv /a /b/c
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!