http://www.technicalpage.net/search/label/SQL

>> mv ( move )


mv  (move command):

This command is used : 
To move file from one folder location to another folder location
and
To rename a file.

To move a file:

Syntax:
mv  fileName  Destination_folderPath

OR
mv  fileName  Destination_folderPath/fileName

mv  file1   /home/folder1/folder2   --- This moves file1 to the destination folder2.  After the move , file1 is no more present in the present directory and will be available in the folder2.

if the destination folder does not have another file with the same file name , then this file will be moved to the destination folder . If the destination folder has another file with the same name , then the file at the destination folder will be replaced by this moved file.

Rename file name :
you can rename the file in the present directory. OR can be renamed while moving to another directory.

mv  fileName1  fileName2  --- fileName1 will be renamed to fileName2

mv  fileName1   /home/folder1/folder2/fileName2   --- fileName1  will be moved from the present directory  to the folder2  with a new name fileName2.

No comments:

Post a Comment