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
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.
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?