I have two files. I want to exclude anything that is in file 2 from file 1.
Example)
File #1 - List of 500 domain names
domain1
domain2
domain3
etc..
File #2 - Alexa's Top 1,000,000 domain names
domain1
domain2
domain3
etc..
I would think this would work.
cat file1 | grep -v -f file2 > results
This always results in "Killed" for anything over 10k+ in file2.
/var/log/messages shows it runs out of memory. The box has 12GB RAM.
Aug 25 02:21:18 V-RHEL-EM kernel: Out of memory: Kill process 13779 (grep) score 860 or sacrifice child
Aug 25 02:21:18 V-RHEL-EM kernel: Killed process 13779 (grep), UID 0, total-vm:9377064kB, anon-rss:7400368kB, file-rss:0kB, shmem-rss:0kB
Is there a better way to do this?