#!/bin/sh
#
# diskhog -- print out a list of files by size, sorted in reverse order of size
#
if test $# -gt 1
then
	echo Usage: $0 basedirectory
	exit 1
fi
if test $# -eq 1
then
	cd $1
	if test $? -ne 0
	then
		echo $0: bad directory $1
		exit 1
	fi
fi
/bin/ls -lRs | awk 'BEGIN { subdir = "/" ; x="'`pwd`'" }
/^\.\/.*:$/		{ subdir = substr( $0, 2, length( $0 ) - 2 )"/"
			next
			}
/^[ 0-9][ 0-9][ 0-9][0-9]/	{ lsstub = substr( $0, 1, 59 )
				printf "%s%s%s%s\n", lsstub, x, subdir, $10
				}' | sort -n -b -r
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
	   go for it!  			allegra,ulysses,vax135}!ttrdc!levy
