#!/bin/csh -f # dubig # ------------------------------------------------------------------------------ # Shell script to show the disk usage of big directory trees. # ------------------------------------------------------------------------------ # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv == 0 || "$1" == "-h" || "$1" == "--help") then echo "Usage: $0:t num_digits [du_options...] [dirs...]" echo "where: num_digits = min number of digits in the count of 1k blocks" echo " du_options = options for the du command" echo " dirs = root directories to be checked" echo "Example: $0:t 6" echo " Show sizes that are at least 100,000k (six digits) of" echo " the current directory and all subdirectories" echo "Example: $0:t 6 fred fred2 fred3" echo " Same for fred, fred2, and fred3 trees" echo "Example: $0:t 6 -a fred fred2 fred3" echo " Same, but show big individual files also." echo "Example: $0:t 6 -d 0 fred fred2 fred3" echo " Same, but don't show details of any nested dir levels" echo "Example: $0:t 6 -d 2 fred fred2 fred3" echo " Same, but only show details of 2 dir levels deep" exit 1 endif set digits = $1 shift du -c -k $*:q | grep -E "^[0-9]{$digits,}" # -c = Display a grand total also # -k = Show sizes in units of kB exit $status