4

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

3

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.

5

Try this in cygwin:

find /cygdrive/f/images -name '*.jpg' -exec cp '{}' /cygdrive/c/Users/Me/Pictures/Phone \;
  • 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
0

Thanks all this was useful thread and Power shell line works perfect

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

if you have 15 GB of pictures some lost ones don't relay matter anymore.. :D Thanks Richard :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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