Linux Classes
Linux Classes
Share This With a Friend
LINUX CLASSES - EMAIL

How Do I Read Email with Linux?

If you log in as hermie now (pressing alt-F2 to access another virtual console would be convenient), you'll be greeted with the following cheery little message: You have new mail.

You can receive and read your incoming email by using the mail command again.

Here's a sample mail session (text in bold is what you would enter):

$ mail

Mail version 5.6 6/1/95. Type ? for help.
"/var/spool/mail/hermie": 1 message 1 new
>N 1 root@fritz.com Mon Feb 10 14:58 "Gone Fishing"
>N 2 D.Rhodes@spam.net Mon Feb 10 15:37 "Make Money Fast!"
N 3 Chris@qwerty.com Mon Feb 10 15:37 "Tennis, Anyone?"
& 1
Message 1:
Date: 1997年2月10日 14:58:12 -0500
From: root@fritz.com
To: hermie@fritz.com
Subject: Gone Fishing
I've decided to kick back this afternoon and go fishing.
So if this crazy Linux system rolls over and dies,
I suggest you do likewise.
& q
Saved 1 message in /home/hermie/mbox
Held 2 messages in /var/mail/spool/hermie

Let's look at what just happened. After you entered the mail command, the system informed you of the version of the mailprogram that is running and told you how to get help for it.

The next line tells you that there is one new message in your mailbox, and that your incoming mail is stored in the file /var/spool/mail/hermie. (Each user on the system has a mail file in the /var/spool/mail directory.) When new mail arrives, Linux tacks it onto the end of the recipient's mail file.

Note: You should never directly edit your mail file--always use mail or another email program to handle your mail. (If you're editing your mail file when a new message arrives, it will be lost.) But it's quite all right to scan your mail file with grep or some other utility that doesn't try to modify it. (You might want to apply grep to your mail to find a particular string, such as the email address of a person who has corresponded with you.)

The next line,

>N 1 root@fritz.com Mon Feb 10 14:58 "Gone Fishing"

is referred to as a header line, and it tells you a number of things. The > tells you which message is the current one--the one you're working with.

The N 1 indicates that you're dealing with message 1 and that it's flagged as a new message. (Later, the flag could be U for unread or O for an old message.) The rest of the line tells you who the message is from, when it was sent, and the Subject line.

The ampersand (&) on the following line is the mail prompt. In this example, we entered a 1 to display the first message, and the message text is shown on the lines that follow. Unfortunately, we can't tell from the context whether to roll over and die or just go fishing.

Previous Lesson: Sending Email
Next Lesson: Other Mail Commands

[ RETURN TO INDEX ]



Comments - most recent first
(Please feel free to answer questions posted by others!)

Rocky Kuang (25 Sep 2014, 12:25)
logwatch is not able to send email out after changing MX record.
Nawal (08 Apr 2012, 11:47)
after reading the messages of the mail, it doesn't get saved to mbox
what shall I do?
Vishal Gujadhur (25 Jan 2011, 13:58)
Hi cane you plz hellp me to my mail as i cant open my mail THXXX...
bilal (28 Aug 2010, 14:17)
Thanks Jorge, This problem is solved now :)
Jorge (27 Aug 2010, 06:20)
Try

./arm_v5t_le-gcc hello.c -o hello

the problem is that this command is not in the search path, so make sure you tell bash where it is, by giving absolute path, for instance, or relative path (as in my answer, where i assume your compiler is in the current directory)
Bilal (01 May 2010, 05:46)

I need to execute simple C code after writing this code and saving it in particular directory mentioned in manual.I have run the following command to execute i.e.
host $ arm_v5t_le-gcc hello.c -o hello

but instead of executing this command successfully I am getthing following error:

bash: arm_v5t-le-gcc: command not found

can you please tell me what does this error means?

(Note:I am working on DSP video kit (by Texas Instruments)that came up with linux softwares.)

Regards
Bilal

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:




Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.

Popular Linux Topics

Linux Intro
Linux Files
Linux Commands
Change Password
Copy Files
Linux Shell Basics

Linux Tutorial

Who is Doctor Bob?
What is Linux?
History of Unix
Operating Systems
What's Next?

Linux Basics

Living in a Shell
Root and Other Users
Virtual Consoles
Logoff and Shutdown
Choosing a Shell
The Command Prompt
Wildcards
Command History
Aliases
Redirection
Pipelines
Processes
Stopping a Program
Environment Variables
Help!

Linux Files

The Linux File System
Linux File Names
Linux Directories
Directory Terminology
Navigating the File System
Listing Linux Files
Displaying Linux Files
Copying and Renaming Files
Creating Files and Directories
Deleting Files and Directories
Linux Files - Wildcards
The Nine Deadly Keystrokes
Linux File Permissions
Changing File Permissions

Linux Commands

Important Linux Commands
Changing Your Password
Switching Users
Who is Logged In?
Date and Time
The Echo Command
Spell Checking
Printing Linux Files
Joining Files
Searching for Files
Comparing Files
Task Scheduling
Linking Files

Linux Editors

The Vi Editor
The Emacs Editor
The Pico Editor

Linux Data Manipulation

Slicing & Dicing
Heads or Tails?
Sorting Data
Eliminating Duplicates
Selecting Columns
Selecting Records
Search & Replace
Crunching Data
Finding Files
Pipe Fitting

Linux Shell Programming

Linux Shell Scripts
Executing a Script
Shell Script Variables
Shell Script Logic
Shell Script Looping
Shell Script Debugging

Perl Programming

Perl Basics
Perl Variables
Perl Arguments
Perl Logic
Perl Looping
Perl and Files
Perl Pattern Matching

Linux and Email

Sending Email
Reading Email
Other Mail Commands
Using Pine for Email
The Pine Inbox
Pine Email Basics
Pine Email Folders
Pine for Power Users

Compression and Encoding

Linux File Compression
Archiving With Tar
Compression With Gzip
Compress and Zcat
Zmore and Zless
Zip and Unzip
Encoding and Decoding
Encryption

Linux Does DOS

Accesing DOS Files
Accesing DOS Partitions
Running DOS Programs

Managing Linux

Updating Your Linux System
Installing Packages with RPM
Uninstalling Packages w/ RPM
Upgrading Packages with RPM
Querying Packages with RPM

AltStyle によって変換されたページ (->オリジナル) /