Commands useful for cleaning up a list of email addresses Did you trim the leading and trailing space? sed -e 's/^ *//' -e 's/ *$//' rawfile > cookedfile Did you try grepping for missing '@' signs? grep -v @ listfile How about spaces, quotes, commas, angles...? grep '[ "<>;,/!#%&()=|\\`~]' listfile How about questionable or missing TLDs? egrep -v '\.(com|edu|net|org|ca|us)$' listfile How about domain names that don't resolve? cut -f2 -d@ lisfile | while read address do if host "$address" > /tmp/foo 2>&1 then echo $address >> gooddomains else cat /tmp/foo fi done | tee bogosity.log