Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

Grep size of email accounts

fedora - qmail

10:19 am on May 25, 2007 (gmt 0)

New User

10+ Year Member

joined:Aug 16, 2006
votes: 0

Hi,i onced used a command line to show the list of email accounts which used the most disk space...that was on a redhat/sendmail setup . i lost the command line query...but i know grep command is involved.

now i have a qmail/fedora setup - mind if anyone could give me the command line to show which accounts are taking up the most space.cause my server is running low on space.

12:56 pm on June 2, 2007 (gmt 0)

Senior Member from ES 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:July 24, 2002
votes: 2

hi bicycling,

list the mail folder (where your inboxes are kept) pipe to awk which prints only the 5th column (which on my system is the size of each mailbox) then pipe to sort, which sorts by size

ls -l /var/mail/ awk '{print $5}' sort


(you'll have to replace the with proper pipes)

12:40 am on June 3, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 31, 2003
votes: 0

Try this to see the username also:
ls -lL /var/mail awk '{print $5, $9}' sort -n

The -L is in case your /var/mail is a symlink, and the -n does a numerical sort rather than an ascii sort.