Unix move multiple files
mvcommand is a command line utility that moves files or directories from one place to another .
- It supports moving single files, multiple files and directories.
Move Multiple Files Linux
- To move a file using the
mvcommand pass the name of the file and then the new name for the file.
- In the following example the file
abc.txtis renamed to
mv abc.txt def.txt
Linux Move Multiple Files
To move a directory using the mv command pass the name of the directory to move followed by the destination.
ls -F abc/ mv abc def ls -F def/
How to Move Multiple Files in Linux
To move multiple files using the
mv command pass the names of the files.
mv file1.txt file.2.txt file3.txt folder
Not overwrite an existing file
- To prevent an existing file from being overwritten pass the
- This causes the
mvcommand to ignore anything that would overwrite an existing file.
ls abc.txt def.txt mv -n abc.txt def.txt ls abc.txt def.txt