Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy all files in ~/Desktop with the extension .jpeg to my flash drive.

How can I do this in the terminal?

share|improve this question


find /source/directory -iname \*.jpeg -exec cp {} /destination/directory/ \;

Where directory is would be your /Users/*username*/Desktop/ directory.

Answer provided from Stack Overflow

share|improve this answer
a simple cp ~/Desktop/*.jpeg /flashdrive is slightly less scary for a Terminal newbie... – MattDMo Jun 20 '13 at 14:36
This worked when the other answer gave me an "Argument list too long" error for ~60k files. – fzwo Apr 13 at 15:58
cp ~/Desktop/*.jpeg /Volumes/flashdrive/

will copy all of the files on the current user's desktop with extension ".jpeg" to the drive named "flashdrive".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.