Gmail provides the ability to view your new/unread email as an ATOM feed via https://mail.google.com/mail/feed/atom.  With cURL and some Perl we can check gmail from the Linux command line.

Just change the email address to your email address and when your hit enter you will be prompted for your gmail password.

#!/bin/bash
curl -u motersho@gmail.com --silent "https://mail.google.com/mail/feed/atom" |
 perl -ne \
  '
    print "SUBJECT: $1 \n" if /<title>(.+?)<\/title>/;
    print "RECEIVED $1 \n" if /<issued>(.+?)<\/issued>/;
    print "FROM: $1 " if /<name>(.+?)<\/name>/;
    print "($1)\n\n" if /<email>(.+?)<\/email>/;
  '