Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • This is not correct. The Output of the file should show ONLY the line whose sting doesn't match with Banned.txt file. Which means, all the domains / strings listed in the Banned.txt file should get deleted in the first file Emails.txt Commented Jan 23, 2019 at 12:46
  • That's the purpose of the -v. Have you tried it?
    – Joce
    Commented Jan 23, 2019 at 12:48
  • 1
    grep -vf worked like a charm... Thanks. Commented Jan 23, 2019 at 12:58
  • 1
    After some more research, I found - Rather using a long regex, this works with this simple line too: grep -vf <(sed 's/$/$/' Banned.txt) Emails.txt Commented Jan 28, 2019 at 12:04
  • 1
    @JoneyWalker Indeed that's shorter!
    – Joce
    Commented Jan 28, 2019 at 15:27