Saturday, May 20, 2006

one-liner to check disk/file systems usage

as requested by my friend, here is the one-liner to check disk/file systems usage that exceed certain percentage:
$ df -k | sed -e 's/%//g' | awk '{if ($5 > 70) print $1 " " $5 " " $6}'
Filesystem capacity Mounted
/dev/md/dsk/d0 82 /
/dev/md/dsk/d8 78 /home

change 70 to any number that suite your need.

No comments: