Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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

Your Answer

 
discard

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.