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

Abhishek Amberkar [अभिषेक] abhishek.amberkar at gmail.com
Wed Aug 25 12:14:41 BST 2010


On Wed, Aug 25, 2010 at 4:30 PM, Jkhatri <khatri.jatin at gmail.com> wrote:
> On Wednesday 25 August 2010 01:55 PM, Ritesh Sinha wrote:
>

>
> Use or modify  following script ---- This will find the file less then 100kb
> ( you can use lt or = also )  -- give you the list of that files and if you
> say "YES" it will delete that file ------
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
> ##/bin/bash -x
>
> dir_to_clean=$1
>
>
>
> cd $1
> ls -l | awk '{if ($5 < 100) print ("rm -f " $8)}' > rmscript.sh
> chmod +x rmscript.sh
> echo "The following files less the 100 will be removed:"
> cat rmscript.sh
>
>
> echo -n "Proceed? [y/n]: "
> read response
> if [ "$response" = "y" ]
> then
> sh rmscript.sh
> fi
>
> rm -rf rmscript.sh
> -------------------------------------------------------------------------------------------------
>

If two binaries can do the trick, why to use multiple?
ls -l will take way long time since OP has 200GB of files. For the
same reason cat rmscript.sh will be useless.





-- 
With Regards
Abhishek Amberkar



More information about the ubuntu-in mailing list