mv xrags and cp

OOzy Pal oozypal at
Mon Jan 15 21:16:53 UTC 2007

I am trying to search for all images in all direcotries under olddir
and cp them to one single direcotry called newdir bearing in mind that
there might be duplicate files


I tried the following but no help

find olddir -name *.jpg |xargs -t -I {} cp {} newdir/{}

I get errors like

cp test/ksi-1253.jpg newdir/test/ksi-1253.jpg
cp: cannot create regular file `newdir/test/ksi-1253.jpg': No such
file or directory

note that there is nothing under newdir


More information about the ubuntu-users mailing list