Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Commands»Bash: mail: command not found (CentOS, Redhat, Ubuntu and Debian)

    Bash: mail: command not found (CentOS, Redhat, Ubuntu and Debian)

    RahulBy RahulOctober 11, 20142 Mins ReadUpdated:February 15, 2021

    With the minimum installation of any Linux operating system, you will not see most of the commands in your system. In minimum operating system installation only required packages are installed for running an operating system and skipped unnecessary packages. mail command is useful for sending emails from Linux command line which is used for almost Linux operating system. Most of Debian based systems will show error like “The program ‘mail’ is currently not installed. You can install it by typing”

    There are many other alternatives to mail command for sending emails from Linux command line interface.

    Installing mail Command

    Let’s use one of below command to install mail command as per your operating system. For RHEL based systems, this command installed from mailx rpm packages and on Debian based system this command found in mailutils package.

    Execute one the following command based on the operating system:

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

      After installing mail command packages in your system, send a test email using below command.

      echo "Message Body" | mail -s "Message Subject" [email protected]  
      
    bash mail
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Extract tar.gz File in Linux
    Next Article How to Configure CGI Scripts in Apache

    Related Posts

    How to Backup Website to Amazon S3 using Shell Script

    Updated:March 24, 20222 Mins Read

    How to Search Recently Modified Files in Linux

    2 Mins Read

    Bash Printf Command

    Updated:December 23, 20212 Mins Read

    Bash Sequence Expression (Define Range)

    Updated:January 12, 20222 Mins Read

    Bash Select Command (Create Menu in Shell Scripts)

    Updated:December 10, 20212 Mins Read

    Bash Break and Continue

    Updated:November 9, 20213 Mins Read

    6 Comments

    1. Moorthy on February 15, 2021 3:43 am

      it is good if you explain how did you solved, it will help for others.

      Reply
    2. Subodh on October 18, 2020 1:46 pm

      Hi Rahul,

      I have installed AMAZON ec2-instance on which I have installed Postfix email service.

      I am not able to send emails using Postfix.

      Can you help?

      Reply
    3. Noah on March 28, 2018 2:47 pm

      I installed the package, and it’s asking for a “postfix configuration.” I can’t select anything. Help!

      Reply
      • Noah on March 28, 2018 2:47 pm

        Never mind. I solved it.

        Reply
    4. bharath on September 8, 2017 12:38 pm

      hi,
      i am not able to send mail with non root user

      Reply
      • Elias, Ederson on September 18, 2017 3:08 pm

        Mr. Bharath

        First to send some email, pleas check if you have a tiny file “.mailrc” in $HOME of this “non root user”.

        Fill the file “.mailrc” with:

        set smtp=smtp.puthereyoursmtpserver
        set ssl-verify=ignore
        set [email protected]
        set font-family:monospace

        enjoy

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.