How to move multiple files at once to a specific destination directory?
You could use:
mv -t DESTINATION file1 file2 file3
The following also works, but I'm not sure if mv
is invoked multiple times or not, as grep
will output a new line for each match:
mv -t DESTINATION `ls|grep IDENTIFIER`
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.