What is this business about mail and Mail?
[On a CentOS box] Why mail does not work but won't return an error either while Mail works fine with the exact same syntax?

Mail is basically a link to mail, isn't it?

Sorry, this was a mixup, apparently (for historical reasons?!) there is a mail and a Mail Nowadays it looks like they both point to the same thing, on my machine:

sr-linux> ls -l `which mail`
-rwxr-xr-x    1 root     mail        66492 Jun 24  2001 /bin/mail
sr-linux> ls -l `which Mail`
lrwxrwxrwx    1 root     root           14 Nov 19  2001 /usr/bin/Mail -> ../../bin/mail
  • what syntax isn't working? What command are you trying to run. I just did a quick test using mail, and Mail on CentOS and it seems to work either way. Can you provide more details? – gabe. Dec 8 '11 at 19:00

Historically, there have been many incompatible extensions of the original mail commnad. Mail came from BSD, and took the name Mail rather than mail because it was shipped alongside the incompatible mail program. Later the same story happened with mailx. For more details, read the Heirloom project's write-up on the different versions of mail. Linux distributions have variously provided one or more of the mail utilities under various names.

For portability, even between installations of the same Linux distribution sometimes, you can't rely on mail. The mailx command is standardized (not with all the options that might exist on a particular system).

If you want a utility that always behaves in the same way provided it's present, and you don't mind that it's often not installed by default, you can use mutt.


On my system, both binaries point to mailx:

max@linux-vwzy:/> which mail
max@linux-vwzy:/> ls -la /usr/bin/mail
lrwxrwxrwx 1 root root 5 Mar  2  2011 /usr/bin/mail -> mailx
max@linux-vwzy:/> which Mail
max@linux-vwzy:/> ls -la /usr/bin/Mail
lrwxrwxrwx 1 root root 5 Mar  2  2011 /usr/bin/Mail -> mailx

Do the same as me to see where mail and Mail are and what they are linked too. That will tell you the details of your system. You're saying you get an error, which leads me to believe that they are NOT pointing to the same application.

According to this article, mailx and Mail are extended versions of the mail command. They have more options, which is why you might be getting errors.

  • 1
    On CentOS: which mail = /bin/mail, which Mail = /usr/bin/Mail, and indeed Mail is just a symlink: /usr/bin/Mail -> ../../bin/mail strange. – gabe. Dec 8 '11 at 18:58
  • @gabe looks to me like it might be there so that other applications which rely on Mail can still work (to an extent). – n0pe Dec 8 '11 at 19:01
  • 2
    do man on both of them. man Mail ; man mail; it sometimes happen that although symlinks point to the same binary, binary may have allowed a logic to allow for different options when it is executed with different basename. – Nikhil Mulley Dec 8 '11 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.