[NTLUG:Discuss] Finding huge files...

Steve Southwell ses at sagepost.com
Fri Apr 23 09:04:42 CDT 2004


Odd thing happened to me yesterday... One of my clients' Apache servers 
just bombed, and SSL wouldn't run, but normal http would.  As it turned 
out, the ssl_engine_log had hit the 2GB limit.  It took me awhile to 
find out what happened, so I wrote this little script to find the 
largest files on the filesystem.  I'd be interested in feedback or 
improvements, or perhaps I'm missing some sort of built-in command to do 
this...

#!/bin/sh
# findbig.sh - Find the largest files on the filesystem
cd /
for line in ` du -a -b 2>/dev/null| sort -g -r |head -n 200| sed 
s/^[0-9]*s*//g$
do
if [ -f $line ]; then
    echo `du -h $line`
fi
done



-- 
Steve Southwell                     214-488-2239 (Voice)
President / CEO                     214-280-6439 (Mobile)
SagePost, Inc.                   http://www.sagepost.com
Internet Data Services Provider






More information about the Discuss mailing list