mv xrags and cp
Florian Diesch
diesch at spamfence.net
Fri Jan 19 13:32:54 UTC 2007
"OOzy Pal" <oozypal at gmail.com> wrote:
>
>>What do you want done with duplcate files?
> there not duplicate in content but they have the same name.
>
> This command is good
> find olddir -name '*.jpg' -exec cp {} newdir/ \;
>
> how can I make the above command rename the file in the format of
>
> date +%s%N.jpg
>
> to make sure that each file gets a unique name?
find olddir -exec sh -c 'cp {} "newdir/$(date +%s%N.jpg)"' \;
Florian
--
<http://www.florian-diesch.de/>
More information about the ubuntu-users
mailing list