Contents[Hide]

1. Name

mv [man page] - move (rename) files

2. Synopsis

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

3. Frequently used options

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

4. Examples

Move whole directory:

mv dir2/ dir1/  

mv - Move whole directory
move content of dir2 to dir1:

mv dir2/* dir1/ 

mv - move content of dir2 to dir1
Use -i option if you re not sure that the target directory does not contain same files or directories. If it does mv will override current files by default.:

mv -i file1 dir1/ 

mv - prompt before overwrite
mv command can be also used to rename files and directories:

mv file1 file2 

mv - rename directory or file



Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top