Medha Cloud Logo

How to Rename Files and Directories in CentOS?

In this post we will see how to rename Files and directories using terminal commands in CentOS. CentOS is a Community Enterprise operating system which mainly focuses on the server. It is a part of Linux Operating System Distribution and it is free to use. First open the terminal.

Total Time Needed: 30 Minutes

Required Tools:

CentOS

Steps to Rename Files and Directories in CentOS

Step 1 : Rename Files
To Rename files use the command mv old_file_name new_file_name. For example to rename file1 to file.txt. Type the command mv file1 file.txt and press enter

Step 2 : Check if Name is Changed
Use the command ls to check if the name is changed. Type ls and press enter. You can see the file name is changed to file.txt.

Step 3 : Rename Directories
To rename Directories, use the command mv. For example, to rename dirc to dirf. Type the command mv dirc dirf and press enter.

Check if Name is Changed- Use the command ls to check if the name is changed. Type ls and press enter. You can see the directory name is changed to dirf .

Conclusion:
To rename Files and directories in CentOS you can follow these steps. If you have any doubts please contact Medha Hosting
Read Here: How To Print File Content To The Screen In CentOS?

Connect with Medha Cloud

Microsoft 365 Migration Form

I would like to send my contact information to MedhaCloud so that MedhaCloud can share additional information about products, services, thought leadership and invitations to flagship events with me by email. *

By submitting this form, I acknowledge that someone from MedhaCloud will contact me via email or phone to discuss my request.

Related Article

View All
chevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram