How can I get number of messages count in Postfix's mailq?
mailq command display entire mails in mailq but i would like to know count only.Is there any command for this. My OS is centos 5.5.
I use this:
mailq | grep -c "^[A-F0-9]"
You can pipe the output of
mailq through various other filters such as
wc to get other statistics.
mailq | tail -n 1 or
find /var/spool/postfix/deferred -type f | wc -l
Pipe the ouput to wc, if further refining is required, use grep.