Parse an email log file

To parse email log file extracting the To and From lines use:

grep -E '( from=| to=)' mail

Note the spaces before the words from and to.

Back to GNU/Linux Command Line Tips