How to move multiple files at once to a specific destination directory?
You could use
mv -t DESTINATION file1 file2 file3
and
mv -t DESTINATION `ls|grep IDENTIFIER`
works, but I'm not sure if mv is invoked multiple times or not as grep will output a new line for each match.
If you want to move ABC-IDENTIFIER-XYZ.ext
or IDENTIFIER-XYZ.xml
, you can use:
mv *IDENTIFIER* ~/YourPath/
*
is a wildcard for zero or more characters, this means zero or more characters, followed by IDENTIFIER
, followed by zero or more characters.
This will move all the files that contain the IDENTIFIER
you specified.
You can use wildcards.
Example: To move all files having extension .doc
mv *.doc /path/to/dest/folder/
This will move all doc file under the current directory to the specific destination.
Edit
To answer the comment.
mv *.ext *.xml *.txt /path/to/dest/folder/