Subscribe to Get Free Material Updates!
Visit my new blog WebData Scraping - Web Scraping Service provider company in India.

Write a script to delete zero sized files from a given directory (and all its sub-directories).


clear
`echo ls`>filelist
for filename in `cat filelist`
do
 if [ ! -d $filename ];then
  size=`ls -s $filename`
  size=`echo $size|cut -d " " -f 1`
   if [ $size -eq 0 ];then 
   echo "Want to Remove $filename:"
   rm -i $filename
  fi
 fi
done

Output:

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes