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 Answers 3

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.

6

Try this in cygwin:

find /cygdrive/f/images -name '*.jpg' -exec cp '{}' /cygdrive/c/Users/Me/Pictures/Phone \;
2
  • 1
    try -iname for case-insensitive matches, some cameras use Uppercase.
    – invert
    Jul 17, 2012 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, 2012 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 :)

2

You must log in to answer this question.

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