← 返回命令列表

Linux command

countmail 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Count messages

countmail

Count messages in a specific

countmail [/var/mail/user]

Count messages in a Maildir

countmail [~/Maildir]

Show unread message count

countmail --unread

Display count for multiple

countmail [mailbox1] [mailbox2]

Output in machine-readable

countmail --quiet [mailbox]

说明

countmail is a simple utility for counting messages in mailboxes. It supports both traditional mbox format files and Maildir directories, automatically detecting the format when possible. The tool is useful for status bars, scripts, and notifications that need to display unread mail counts. It can process multiple mailboxes and output results suitable for parsing by other programs. countmail reads mailbox headers efficiently without loading entire messages, making it fast even for large mailboxes. It can distinguish between read and unread messages based on standard mail flags.

参数

--unread
Count only unread messages.
--read
Count only read messages.
--quiet
Output only the number, no labels.
--mbox
Treat the path as mbox format.
--maildir
Treat the path as Maildir format.
-h, --help
Display help information.

FAQ

What is the countmail command used for?

countmail is a simple utility for counting messages in mailboxes. It supports both traditional mbox format files and Maildir directories, automatically detecting the format when possible. The tool is useful for status bars, scripts, and notifications that need to display unread mail counts. It can process multiple mailboxes and output results suitable for parsing by other programs. countmail reads mailbox headers efficiently without loading entire messages, making it fast even for large mailboxes. It can distinguish between read and unread messages based on standard mail flags.

How do I run a basic countmail example?

Run `countmail` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --unread do in countmail?

Count only unread messages.