Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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'm running on Windows but have Cygwin so Windows or simple Linux versions are both OK.

My camera-phone stores images in a directory tree based on date, but still appears to name each file uniquely. I want to copy all files into one directory on my PC without all the sub-dirs. How can I do this?

Copying with sub-dir structure is easy: xcopy f:\images\*.jpg C:\Users\Me\Pictures\Phone

share|improve this question
up vote 2 down vote accepted

Try this in PowerShell:

dir f:\images -recurse -filt *.jpg | copy -dest C:\Users\Me\Pictures\Phone

Note: - This will overwrite files with the same name already in the destination even if resulting from this copy - Add a -verbose to the copy to see what is being copied.

share|improve this answer

Try this in cygwin:

find /cygdrive/f/images -name '*.jpg' -exec cp '{}' /cygdrive/c/Users/Me/Pictures/Phone \;
share|improve this answer
try -iname for case-insensitive matches, some cameras use Uppercase. – invert Jul 17 '12 at 9:55
And try replacing the \; with + for marginally faster results (this will execute one cp for all the files, rather than one per file). – me_and Jul 17 '12 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .