Check for valid of invalid emailaddresses with egrep

Xterm.png

If you want to check if a file, like a csv-file with e-mail-addresses for a newsletter, contains invalid formatted email-addresses then you can use this egrep command.

egrep "\w+([._-]\w)*@\w+([._-]\w)*\.\w{2,4}" emial.csv -vn

Input file email.csv is a file containing all the email-addresses.