Someone gave me a bunch of PDF files spread out through multiple subdirectories and I needed to get them all into a single directory.
In Mac OS X (and probably Linux) this will scan through the directory specified and its subdirectories and copy all of the PDF files to the target directory:
find /Users/joedokes/Desktop/source_directory -name "*.pdf" -exec cp {} /Users/joedokes/Desktop/target_directory \;
2 comments:
On linux, it should look like this:
find /path -name "*.pdf" -exec cp {} /dest_path \;
Omitting the '-name' and '*' will fail to get what you want.
Thanks for the correction wari!
Post a Comment