You need to use the mv command to move folder, files, and directories in Linux terminal. The syntax is as follows:
mv source target
mv folder1 folder2 target
mv folder1 file1 target
mv -option source target
The following example would move a folder named documents, without changing its name, from the current directory to an existing subdirectory of the current directory named /backups:
mv documents /backups |
mv * /nas03/users/home/v/vivek |
mv /home/tom/foo /home/tom/bar /home/jerry |
cd /home/tom mv foo bar /home/jerry |
mv -v /home/tom/foo /home/tom/bar /home/jerry |
`/home/tom/foo/' -> `/home/jerry/foo' `/home/tom/bar/' -> `/home/jerry/bar'You can prompt before overwrite i.e. pass the -i option to make mv interactive if the same name files/folder already exists in the destination directory:
mv -i foo /tmp |
mv: overwrite `/tmp/foo'?
No comments:
Post a Comment