Pages

Saturday, February 5, 2011

Check your unread GMail e-mails using the Linux command line


All you need to display your latest GMail messages in the command line is this one-liner:



curl -u username:password --silent “https://mail.google.com/mail/feed/atom” | tr -d ‘\n’ | awk -F ‘<entry>’ ‘{for (i=2; i<=NF; i++) {print $i}}’ | sed -n “s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p”


Substitute username:password with your GMail username and password

No comments:

Post a Comment

Write Your Experience and Suggestion Please.