How to Find and Copy a Type of File Using "Find" tool

Have you ever needed to collate all of a certain type of file from a disk or a machine? If so the command line “find” tool is a very powerful way search for a specific type of file on a volume or a disk, check out the manual page (man find).

I recently wanted to grab all jpeg files from my machine and put them in a single folder, here’s how I did it:

find / -name “*.jpg” -exec cp {} /Users/pete/jpegs ;

Leave a Reply

Your email address will not be published. Required fields are marked *