Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/bin/ksh
#####################################################################
# TITLE: uxspace
# AUTHOR: Adam Forrest
# DATE: March 2002
# USAGE: Sorts filesystem usage by % space or inodes used
#####################################################################
me=`basename $0`
HDR1="Unix Filesystems by Space Usage (Kb)"
HDR2="===================================="
HDR3="\nFilesystem %Used Capacity Used Free"
EXCLUDE_LIST="/dev/fd|/stats|/proc|filesystem"
P_HDR1="Summary of "
P_HDR2="======="
VERSION="1.0"
LIST()
{
head -10
}
USAGE()
{
echo "Usage: $me [ -l ] [ -i ] [ -v ]"
echo "Where -l long listing"
echo " -i Filesystem inode details"
echo " -v Program version details"
exit 1
}
DF_CMD()
{
df -k | egrep -v -i "$EXCLUDE_LIST" | sort -n -r +4.0 -5.0| LIST | awk '{printf "%-32s %+4s %+8s %+8s %+8s\n", $6, $5, $2, $3, $4 }'
}
WHICH_OS()
{
uname -a | awk '{print $3}' | while read OS
do
if [ $OS = 5.6 ] ; then
INODE_DF="/usr/bin/df -oi"
else
INODE_DF="/usr/ucb/df -i"
fi
done
}
while getopts flvi val 2>/dev/null
do
case $val in
f) ;;
l) LIST()
{
tr " " " "
}
P_HDR1=""
P_HDR2="";;
v) echo "This is version $VERSION of $me"
exit 1 ;;
i) WHICH_OS
HDR1="Unix Filesystems by Inode Usage"
HDR2="==============================="
HDR3="\nFilesystem %IUsed Iused Ifree"
DF_CMD()
{
$INODE_DF 2>/dev/null | egrep -v -i "$EXCLUDE_LIST" | sort -n -r +3.0 -4.0 | LIST | awk '{printf "%-32s %+4s %+8s %+8s\n", $5, $4, $2, $3 }'
}
;;
v) echo "Version 1.0";;
*) USAGE ;;
esac
done
shift `expr $OPTIND - 1`
echo "\t$P_HDR1$HDR1\n\t$P_HDR2$HDR2$HDR3"
DF_CMD|LIST
echo