> 2. As pointed out by post above, is there a chance of a match on a sub name, like moofoo and foo
Yes. There might be a chance that this might happen. That is why I put "@" before the foo.com just to make sure it would not match moofoo.com
> 1. Is is at the end of a line? otherwise Daniel's suggestion will not work
I am not sure if I get it right but I assume yes because in my example, it is a lists of email address.
john@foo.com
jean@foo.com
mark@foo.com.cn
Looks like Daniel's suggestion works. Why I forgot the $ geezz
Code:
[root@packets tmp]# cat users.txt
john@foo.com
jean@foo.com
jean@moofoo.com
mark@foo.com.cn
[root@packets tmp]# cat users.txt | grep -v "@foo.com$"
jean@moofoo.com
mark@foo.com.cn