If you want to check new emails on your Gmail account from the command line, here is the how to:
curl -u username --silent "https://mail.google.com/mail/feed/atom" \ | perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
You will be prompted for a password before the information is gathered. Please notice that you need to change username to your Gmail username before executing.