8
rated 0 times
[
8]
[
0]
/ answers: 1 / hits: 19826
/ 3 Years ago, tue, may 25, 2021, 9:45:58
I want a command that allows to select specific files based on their extensions to move them to another directory.
More From » command-line
I want a command that allows to select specific files based on their extensions to move them to another directory.
You can do this easily from one directory with:
mv /path/to/original/directory/*.pdf /path/to/new/directory
The command for a recursive move can be a little more complex. This should do the trick though:
find /original/directory/ | grep '.pdf' | xargs -I {} mv {} /path/to/new/directory/
With the second command /original/directory
will be search recursively for .pdf
files.