In the process of using Unix or Linux on the command line, you may have encountered the “You have mail” message. It can be encountered on Linux servers or on local desktop environments, such as Mac OS X. While somewhat alarming and confusing, especially the first time, this is generally a fairly trivial message and easy to remove. This post will look at what the *nix
echo "How about 1pm?" | mail -s "Let's get lunch today" email@example.com
The above command will send an email with the content of “How about 1pm?” and a subject of “Let’s get lunch today” to
To check for mail, you can simply enter:
If there is new mail, the application will display a list of the emails, their subject, date and other info — essentially like a proto-email inbox:
If there is no new mail, the command line will simply read:
No mail for [user], where
[user] is the name of your computer system or server.
Why is mail being sent to the operating system email client?
If you have not specifically and intentionally set up
How to remove the “You have mail” message
To remove the “You have mail” message, open the Finder application, then select “Go to folder…” from the “Go” dropdown menu (Shift + Command + G). From there, type in
[user] is the username of your system (in my case,
(Note: if you try to do this when there is no new mail, Finder will say “The folder can’t be found.”)
Hit “Go”, and the Finder application should display a mail file in the
Simply delete this file, empty your trash and open a new terminal window. You should no longer see “You have mail” display. You can also verify this by entering
No mail for [user].
As an alternative to the method above, you can also remove the mail file from the command line.
Navigate to your home directory (from any directory you’re in):
Go back 2 directories to the root directory:
Go to the mail directory:
If you type
ls it should list the same mail file we removed from the Finder. To remove it simply type
rm [filename] . Make sure you are removing the right file, as there is no way to retrieve it from the Trash bin via this method.
- Photoshop Retouching
- Bash vs Zsh: A comparison of two command line shells (2018 Update)
- An Introduction to Version Control using Git (2018 Update)
- Choosing The Best Text Editor For Web Development
- Introducing Gutenberg, the new WordPress editor
- Our custom design process
- Sunlight Media Delivers According to Research Firm Clutch
- An introduction to the htaccess file (2018 Update)
- Using node-sass to compile Sass files in an npm script
While always deeply interested in technology since childhood, Nicholas has been involved in web development in a professional capacity since 2012, as both a front-end developer and project manager.