mv xrags and cp
Florian Diesch
diesch at spamfence.net
Fri Jan 19 13:34:33 UTC 2007
John Dangler <jdangler at atlantic.net> wrote:
>>
>> 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?
>>
> write a shell script around the command like...
> for word in `find olddir -name '*.jpg'
> do
> ... copy command
> done
This will fail if there are filenames containing whitespaces.
Florian
--
<http://www.florian-diesch.de/>
More information about the ubuntu-users
mailing list