#!/bin/sh

# A shell script to tell you what subdirs of a dir you have and how big they are
# (c) 2002 Sinclair InterNetworking Services
# Web:		http://www.sins.com.au/unix 
# Email:	dudirs@sins.com.au
# Distributed free under the GNU GPL available at http://www.sins.com.au/nmis/gpl.txt
# No warranties 

original=`pwd`
dir=`pwd`

if [ $1 ]
then
	dir=$1
fi

if [ ! -d $dir ]
then
	echo "$dir does not exist"
	echo "USAGE: dudirs dirname"
	exit
fi

cd $dir

echo "du -k for subdirs in $dir`:"

for file in `ls`
do
	if [ -d $file ]
	then
		echo "`du -ks $file`"
	fi
done

cd $originaldir
