Subscribe Add to Technorati Favorites

Wednesday, June 25, 2008

This time its a Shell script

This small shell script is to find the sizes of each folder under pwd:

This script will print folder names along with its size. The output is redirected to a temp.txt, you can change the name of the file.

Run this script in bash.

find -type d -maxdepth 1 | while read dir; do
if [ $dir == "." ]; then
continue;
else
du -sh $dir;
fi;
done > temp.txt

0 comments: