Mv


From Linuxconfig.org

Jump to: navigation, search

.. back to the list of Linux Commands

Name

mv - move (rename) files

Synopsis - man page

mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

Frequently used options

-f, --force
              do not prompt before overwriting
-i, --interactive
              prompt before overwrite

Examples

Move whole directory:

mv dir2/ dir1/ 
Image:mv01.gif

move content of dir2 to dir1:

mv dir2/* dir1/
Image:mv02.gif

Use -i option if you re not sure that the target directory does not contain same files or directories. If it does mv we override current files.:

mv -i file1 dir1/
Image:mv03.gif

mv command can be also used to rename files and directories:

mv file1 file2
Image:mv04.gif

.. back to the list of Linux Commands

Personal tools
Linux Commands