Check Linux Foldersize

I don’t know if there are any utilities out there to show the sums of folder size or by using “du” option. So here I create a small script to check, with looping of “du” command. you can give a paramater like

# ./foldersize.sh /var/lib/mysql

To show how much each folder/database have. So here foldersize.sh script

#!/bin/bash
ls -1d $1/* > /root/folderlist.txt
while read FOLDER
do
      du -hs $FOLDER
done < /root/folderlist.txt
SocialTwist Tell-a-Friend

Leave a Reply