SoFunction
Updated on 2025-03-09

Get new gmail messages from linux through the command line

Get new gmail emails through the command line in Linux without entering @ part

#!/bin/bash
 
num="\033[1;36m"
end="\033[0m"
 
read -p "Enter your mail: " name
read -p "Enter pass of mail: " pass
 
atom=`wget -qO - https://$name:$pass@/mail/feed/atom \
 --secure-protocol=TLSv1 -T 3 -t 1 --no-check-certificate | grep \
 fullcount | sed -e 's/<fullcount>\(.*\)<\/fullcount>/\1/'`
 
echo -e 'You have '$num$atom$end' new letters.'

The above is the entire content of this article, I hope you like it.