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

Ramnarayan.K ramnarayan.k at gmail.com
Wed Aug 25 15:37:11 BST 2010


Hi Jatin

Thanks for the script

See below for what i tried

On 8/25/10, 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
> -------------------------------------------------------------------------------------------------

I tried it but killed it before the Y

why ?
because /home/himal is where all my config files are located and if i
delete all files below 100 kb am in danger of deleting something that
will make i desktop unusable

second my target is only jpg files ??

any more ideas how to rectify script

thanks
ram



More information about the ubuntu-in mailing list