$ grep -vcP '^.+@.+\..+$' input.txt 2744965924 $ grep -vP '^.+@.+\..+$' input.txt > notmail.txt $ wc -l notmail.txt 504067727 notmail.txt $ grep -vP '^.+@.+\..+$' input.txt | wc -l 504067727