Tuesday, October 2, 2018

mv command examples

mv Command

1) Rename a file in same directory by mv command
mv abc.txt abc1.txt

2) Move a file in a directory 
mv abc.txt /home/unix/

3) Rename a file and Move to in a directory 
mv abc.txt /home/unix/abc1.txt

4) Move multiple files with same extension in a directory 
mv *.txt /home/unix/

5) Move multiple files in a directory 
mv abc.txt abc1.txt abc2.txt /home/unix/

6) Move a directory in a another directory 
mv xyz /home/unix/

No comments:

Post a Comment

Remove CTRL-M characters from a file in UNIX

 We can remove ^M by below methods 1st Method - Using sed command Type below command:    sed -e "s/^M//" filename > newfilena...