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

»»»Mail: Command Not Found in Linux (RedHat / CentOS / Debian / Ubuntu)
In Linux operating system such as Red Hat Enterprise Linux (RHEL), CentOS and Ubuntu, the following error may occur mail when running mail command to access a mailbox, maildir, mail file:

-bash: mail: command not found

The error simply means that the mail package is not installed or the mail script is not present on the system. To resolve the issue, install the mailx or mailutils package. Mailx is an enhanced mail command, which provides the functionality of the POSIX mailx command, as well as SysV mail and Berkeley Mail from which it is derived. Mailx is available for RHEL, CentOS, Scientific Linux or their variants. Meanwhile, Mailutils provides a set of useful mail libraries, daemons, clients and servers for delivering and reading electronic mail, and is available in Debian, Ubuntu or their variants.

Depending on the Linux distribution you’re using, use one of the following command to install the mailx.

Red Hat / CentOS / Scientific Linux

yum -y install mailx

Debian / Ubuntu

sudo apt-get install mailutils

Mail Command Not Found

By |2016-12-09T08:39:15+00:00December 9th, 2016|Categories: Linux|Tags: , , , , , , , |0 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.