Check mails in Gmail from command line

Wed, 9 Sep. 2009     Thomas Bendler     ~ 1 min to read

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.



Share on: