Linux command
from 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show all mail senders
from
Show senders for a specific user
from [username]
Filter messages by sender
from -s [alice@example.com]
Count the number of messages
from -c
Check a specific mailbox file
from -f [/var/mail/user]
说明
from displays the header of each message in a mailbox, showing who mail is from (and, depending on the implementation, subject and date). It reads the system mailbox (typically /var/mail/username) and prints one line per message. The tool provides a quick overview of pending mail without opening a full mail client. With -s, output is filtered to messages whose sender matches the given address or substring. This is useful for checking mail status in shell scripts, cron jobs, or quick terminal checks.
参数
- -s _SENDER_
- Only print headers from messages whose From address matches the given string. _Note:_ this does not show subject lines.
- -f _FILE_
- Read from the specified mailbox file instead of the default system mailbox.
- -c
- Print only the count of messages. _GNU mailutils only_; not available in BSD/OpenBSD from.
- -d, --debug
- Print debugging information. _GNU mailutils only._
- -V, --version
- Display version information. _GNU mailutils only._
FAQ
What is the from command used for?
from displays the header of each message in a mailbox, showing who mail is from (and, depending on the implementation, subject and date). It reads the system mailbox (typically /var/mail/username) and prints one line per message. The tool provides a quick overview of pending mail without opening a full mail client. With -s, output is filtered to messages whose sender matches the given address or substring. This is useful for checking mail status in shell scripts, cron jobs, or quick terminal checks.
How do I run a basic from example?
Run `from` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s _SENDER_ do in from?
Only print headers from messages whose From address matches the given string. _Note:_ this does not show subject lines.