how to move specific files based on their extensions

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.


why not cp /path/to/dir/where/pdf/are/*.pdf /path/to/where/ever