Solved – Mail: Command Not Found in Linux (RedHat / CentOS / Debian / Ubuntu)

The below error may occur “mail command not found” when we were trying to run the mail command to access a mailbox, maildir, mail file in Linux operating system such as Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu and Debian.

mail: command not found

or

The program ‘mail’ is currently not installed

To resolve this mail s issue.You can install the mail command as per your operating system.

How to Install mail Command ?

  • For Installing mail command on CentOS/Redhat 8/7/6/5 you can use below command.

yum install mailx

or

yum -y install mailx

  • For Installing mail command on Fedora 22+.

dnf install mailx

  • For Installing mail command on Ubuntu/Debian/LinuxMint.

sudo apt-get install mailutils

Once the mail command packages successfully installed in your system, you can send a test email using below command.

echo “Message Body” | mail -s “Message Subject” receiver@domain.com

mail command not found

That’s it Guys hope the issue is now resolved let us know in comment box in case if ypu are still facing any issue while installing mail command.

 

30 Basic UNIX Commands List With Examples

Continue reading at https://www.trenovision.com/?s=unix+command