Trending News

Blog

Bash: mail: command not found in Linux (RedHat / CentOS / Debian / Ubuntu)
Debian

Bash: mail: command not found in Linux (RedHat / CentOS / Debian / Ubuntu) 

You can not see any of the commands in your system if you just install the bare minimum in any Linux operating system. Just the packages required to run the operating system are installed in a minimal operating system installation, and unnecessary packages are skipped.

Table of Contents

The mail command is useful for sending emails from the Linux command line, which is available on nearly all Linux distributions. The error “The program ‘mail’ is currently not installed” or “Bash: mail: command not found” would appear on most Debian-based systems. Installing it is as easy as typing”

Command not found

There are also other options for sending emails from the Linux command line interface besides the mail command.

How to install Mail Command

Use one of the commands below to install the mail command for your operating system. This command is installed from the mailx rpm packages on RHEL-based systems, and it was found in the mailutils package on Debian-based systems.

Depending on the operating system, run one of the following commands:

  • To install the mail command on CentOS/Redhat 7/Redhat 6
    sudo yum install mailx 
  • To install the mail command on Fedora 22+ and CentOS/RHEL 8
    sudo dnf install mailx 
  • To install the mail command on Ubuntu/Debian/LinuxMint
    sudo apt-get install mailutils 

Sending a Test Email

Send a test email using the command below and installing mail command packages on your system.

echo "Message Body" | mail -s "Message Subject" receiver@example.com  
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on reddit
Share on vk
Share on tumblr
Share on skype
Share on stumbleupon
Share on whatsapp

Related posts

Leave a Reply

Required fields are marked *