Contents...
Most of commands you will not see in Linux operating system if you have installed minimum installation. If you have minimum operating system installation you will get only required packages on the system and it skipped all unnecessary packages.
Mail command is one of them which is used for sending mail from Linux command line.
In this tutorial I am going to explain how we can install mail command on Redhat, CentOS, Fedora, Ubuntu and Debian system.
You can also find many other alternative of mail command which is used for sending mail form Linux command line like sendmail and mutt etc. but I thing mail command is more popular.
Mail Command Installation on CentOS/Redhat system
Follow the below Linux command to install mail command on Unix or Linux system
#yum install mailx
You will get some output like below:
Loaded plugins: priorities, update-motd, upgrade-helper Resolving Dependencies --> Running transaction check ---> Package mailx.x86_64 0:12.4-8.8.amzn1 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================================ Installing: mailx x86_64 12.4-8.8.amzn1 amzn-main 254 k Transaction Summary ================================================================================================================================================================ Install 1 Package Total download size: 254 k Installed size: 451 k Is this ok [y/d/N]: y Downloading packages: mailx-12.4-8.8.amzn1.x86_64.rpm | 254 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : mailx-12.4-8.8.amzn1.x86_64 1/1 Verifying : mailx-12.4-8.8.amzn1.x86_64 1/1 Installed: mailx.x86_64 0:12.4-8.8.amzn1 Complete!
Mail Command Installation on Ubuntu/Debian System
Follow this below command to install mail command on Ubuntu/Debian System.
#apt-get install mailutils
Mail command has been installed successfully on your Linux system. Now check it is working or not.
Testing
Follow the below command to send mail from your Linux command line for testing purpose:
# echo "Type Message Body Here" | mail -s "Type Message Subject Here" [email protected]
You will get a mail in your receiver mail inbox like below.
I hope this article will be helpful to install Mail Command On Redhat, CentOS, Fedora, Ubuntu and Debian System .
Thanks:)
If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.
Tks!
Nice Article Thanks.