On Wednesday 25 August 2010 04:44 PM, Abhishek Amberkar [अभिषेक] wrote:
On Wed, Aug 25, 2010 at 4:30 PM, Jkhatri<[email protected]> 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.
That is why I told _*use or modify*_
Warm Regards
--
Jatin Khatri
Web www.khatrijatin.co.nr <http://www.khatrijatin.co.nr/>
www.fedoraproject.org/wiki/Jatin <http://www.fedoraproject.org/wiki/Jatin>
Phone (+91) 98250 20393
Save Paper, Save Environment.**
/*(Plant at least one tree in your life and nurture it !!!)*/
--
ubuntu-in mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-in