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.
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/jsmithWhere 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/jsmithYou need to me root to read other people's mail.
Add a commentSign in to add a comment