DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Disk Usage Statics Shell

08.25.2009
| 2767 views |
  • submit to reddit
        // description of your code here

dirs=`ls`
for dir in $dirs
do
        if [ -d $dir  ]
        then
                size=`cd $dir;du -sh`
                echo "$dir      $size"
        fi

done