How to move or rename files in linux
How to move or rename files in linux
move command name in linux
mv [man page] – move (rename) files
2. Synopsis for mv command
mv [OPTION]... [-T] SOURCE DEST mv [OPTION]... SOURCE... DIRECTORY mv [OPTION]... -t DIRECTORY SOURCE...
3. move command frequently used options
-f, --force do not prompt before overwriting -i, --interactive prompt before overwrite
4. Examples of move command
Move whole directory:
mv dir2/ dir1/
move content of dir2 to dir1:
mv dir2/* 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 command can be also used to rename files and directories:
mv file1 file2
Source taken from http://linuxconfig.org/
Comments are closed.