#!/bin/env ksh # Metrics on a directory structure # Author: Dick.Dunbar@Oracle.com echo ' Size Dirs Links Files Path' typeset -R7 _sz _di _ln _fi for _dir in $* ; do _sz=$(du -hs $_dir | awk '{print $1}') _di=$(find $_dir -type d | wc -l) _ln=$(find $_dir -type l | wc -l) _fi=$(find $_dir -type f | wc -l) echo "$_sz $_di $_ln $_fi $_dir" done