main logo

How to Move Files and Directories in CentOS?

Share
Try Medha Cloud for free
Click below to sign up and get $200 of credit to try our products over 60 days!
Contents
Rakshitha
Rakshitha is a cloud hosting expert who helps businesses get the most out of their cloud services. She has experience setting up and managing cloud environments to improve performance and scalability. With her cloud certification, Rakshithe provides clear advice on how to use cloud solutions effectively for better business results.

 

In this post we will see how to move 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 move Files and Directories in CentOS

Step 1 : Move Files
To move files use the command mv source destination. For example, to move a file 1.txt to directory Documents. Type the command mv 1.txt Documents and press enter.

Step 2 : Move Directories
To move Directories use the command mv. For example, to copy dir5 to dirc type the command
mv dir5 dirc and press enter. If the directory is already present in dirc, the terminal will ask you for confirmation. Type y for yes and press enter.

Step 3 : Move Directories without Terminal Asking for Confirmation
To move Directories without terminal asking for confirmation using the command
mv –f source destination. For example, to move dir5 to dirc without asking for confirmation type, the command mv –f dir5 dirc and press enter

Step 4 : Move Multiple Files
To move multiple files, use the same command mv but add Multiple sources and a single destination. For example, to move 2.txt, 3.txt, 4.txt to downloads. Type the command mv 2.tct 3.txt 4.txt Downloads and press enter.

Step 5: Move Files and Check Summary
To moves files and check summary use the command mv –v source destination. For example, to move 2.txt, 3.txt, 4.txt to downloads and check summary type the command
mv –v 2.tct 3.txt 4.txt Downloads and press enter.

Conclusion:
You can easily move files and directories in CentOS following these steps. However, if you got any doubts and need help to manage you Linux infrastructure please contact Medha Hosting.
Read Here: How to Copy Files and Directories in CentOS?

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Hosting Private Limited
#74, 7 Th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.