On Wed, Aug 25, 2010 at 4:30 PM, Jkhatri <khatri.ja...@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 -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in