[ubuntu-in] Strange problem with too many jpg files in one folder

Ramnarayan.K ramnarayan.k at gmail.com
Wed Aug 25 16:52:14 BST 2010


Hi

seems to be partly solved.

These are the commands i am using from within the said directory

$ find -H -iname 'image3*.jpg' -type f -size -100
this to see if the command works

then tried this

$ sudo find -H -iname 'image3*.jpg' -type f -size -100k -exec rm -rfv '{}' \;


and now i am able to delete all the stuff i don't need

its taking a bit of time - i think its close to 4 lakh files :-( -
most of them are internet images from the websites.

thanks for all the advice, i think for the time being the problem is
solved will let you know once the multiple deletes are done

regards
ram

On 8/25/10, Ritesh Sinha <ritesh.kumar.sinha at gmail.com> wrote:
> On Wed, Aug 25, 2010 at 08:47:47PM +0530, Abhishek Amberkar [अभिषेक] wrote:
>> On Wed, Aug 25, 2010 at 7:53 PM, Ramnarayan.K <ramnarayan.k at gmail.com>
>> wrote:
>> > further tweaking gets me here
>> > # find /home/himal/ size +1000 -name image3*.jpg -exec mv '{}'
>> > /home/himal/Pictures/recovered/bigger800kb/ \;
>> > find: paths must precede expression: image301001.jpg
>> > Usage: find [-H] [-L] [-P] [-Olevel] [-D
>> > help|tree|search|stat|rates|opt|exec] [path...] [expression]
>> >
>> >
>>
>> find /home/himal/ size +1000 -name 'image3*.jpg' -exec mv {}
>> /home/himal/Pictures/recovered/bigger800kb/ \;
>>
>> This should do the trick.
>>
>> Don't use single quotes around the curly braces next to "mv" and make
>> sure argument to "-name" to be in single quotes.
>>
> I was testing this out, the problem is with find complaining about the
> argument list (too large).
>
> For testing I did this inside a folder
> # for i in $seq(50000); do touch ${i}.jpg; done
> then tried ls, mv etc. Worked like a charm, I have a hunch that there is
> a limitation in ext3 (I'm using ext4).
>
>>
>> --
>> With Regards
>> Abhishek Amberkar
>>
>> --
>> ubuntu-in mailing list
>> ubuntu-in at lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
>
> --
> ---
> GPG : 2048R/B8914BE6 2010-04-18
> ritesh-sinha.com
>
> --
> ubuntu-in mailing list
> ubuntu-in at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
>



More information about the ubuntu-in mailing list