Dave's Brain

Browse - Computer Tips - How can I quickly read mail on the command line?

Date: 2012mar11
OS: Linux

Q.  How can I quickly read mail on the command line?

A.  The regular thing is to use mailx or mutt but sometimes you want
a quick-and-dirty way.  Here it is:

grep ^From /var/mail/jsmith
Where jsmith is a userid. Will list all the mail to that user. Make sure you put "From" in that case. You can get more headers for each message like this:
grep -C 5 ^From /var/mail/jsmith
You need to me root to read other people's mail.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.