View Single Post
Old 04-11-2003, 02:04 PM   #3 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
heh i got bored so heres one for you if you have files scattered all over the system, use with caution or your sys admin will hate you (youll understand when you look at the code)

Code:
#!/bin/sh

FILES=`find / -user $1 2>/dev/null`
SIZE=0
for i in ${FILES}
do
    TMP=`du ${i}|cut -f 1 2>/dev/null`
    if [ ! $? -eq 1 ]; then
        let "SIZE=${SIZE}+${TMP}" 2>/dev/null
    fi
done
PERCENT=`bc << EOF
(${SIZE} * 100) / 76800
EOF`
echo "Quota size is ${SIZE}k using ${PERCENT}%"
not perfect but whatever
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote