
mutt Command in Linux
mutt is a text-based email client designed for Unix-like operating systems. Renowned for its speed and simplicity, mutt allows users to manage emails directly from the command-line.
Whether you're dealing with multiple inboxes, handling attachments, or navigating through threaded conversations, mutt has the tools you need to streamline your email experience.
Table of Contents
Here is a comprehensive guide to the options available with the mutt command −
- Installing mutt Command
- Syntax of mutt Command
- mutt Command Options
- Examples of mutt Command in Linux
Installing mutt Command
To get started with mutt, you need to install the mutt package on your Linux system. The method of installation depends on which Linux distribution you are using.
On Debian-based Systems (e.g., Ubuntu)
sudo apt install mutt
On Red Hat-based Systems (e.g., Fedora)
sudo dnf install mutt
On SUSE-based Systems (e.g., openSUSE)
sudo zypper install mutt
Syntax of mutt Command
The basic syntax for the mutt command allows you to compose, send, and read emails from the command line interface. The general format is as follows −
mutt [options] [arguments]
Where −
- [options] are optional flags that modify the behavior of the command.
- [arguments] include email addresses, file paths, and other parameters.
mutt Command Options
The mutt command supports various options that you can use to customize its behavior. Here are some of the key options −
Option | Description |
---|---|
-s | Sets the subject of the email. |
-a | Attaches a file to the email. |
-b | Adds a BCC (Blind Carbon Copy) recipient. |
-c | Adds a CC (Carbon Copy) recipient. |
-f | Specifies the mailbox to read emails from. |
-e | Executes a command before running mutt. |
-n | Prevents reading the configuration file. |
-F | Specifies an alternate configuration file. |
-R | Opens mutt in read-only mode. |
-y | Forces mutt to display the "From" header. |
-z | Suppresses the initial display of the message index. |
-H | Reads the specified file and uses it as a draft. |
-N | Disables automatic check for new mail. |
-X | Excludes messages matching the specified pattern. |
Examples of mutt Command in Linux
Here are some practical use cases to show you how to use mutt on your Linux system −
- Reading Emails
- Sending Emails
- Adding Attachments
- Using CC and BCC
- Specifying an Alternate Configuration File
Reading Emails
To read emails using mutt, simply type the command −
mutt
This command opens mutt and loads the current user's mailbox, allowing you to read your emails. You can navigate through your messages, reply, forward, and organize them using various mutt commands.

Sending Emails
To send an email with a subject, use the following command −
mutt -s "Subject Here" recipient@example.com
This command sends an email to recipient@example.com with the subject "Subject Here". You will be prompted to enter the body of the email in the editor specified by mutt.

Adding Attachments
To send an email with an attachment, use the -a option −
mutt -s "Subject Here" -a /path/to/attachment recipient@example.com
This command attaches the specified file to the email being sent. You can add multiple attachments by specifying additional -a options.
Using CC and BCC
To add CC and BCC recipients, use the -c and -b options −
mutt -s "Subject Here" -c cc@example.com -b bcc@example.com recipient@example.com
This command sends an email to recipient@example.com with CC to cc@example.com and BCC to bcc@example.com.
Specifying an Alternate Configuration File
To use an alternate configuration file, use the -F option −
mutt -F /path/to/alternate/muttrc
This command starts mutt with the configuration specified in the alternate .muttrc file. This is useful for testing different configurations or using multiple email setups.
Conclusion
The mutt command is an incredibly powerful and flexible email client for the command line. Its rich feature set and extensive configuration options make it a preferred choice for many Unix and Linux users. Whether you're reading, sending, or managing emails, mutt provides the tools needed for efficient email handling.