Issue
So I am running Centos 6.9, but could switch to Centos 7 if needed
If I have 2 txt files, one contains
Gold
Silver
Copper
Aluminum
Titanium
And my second contains
Gold
Silver
Titanium
How can I run a command to have a file that contains
Copper
Aluminum
Summarized: How can I remove lines in a file which match those of another file
Solution
This can easily be done with grep
laforge@ncc1701d:~ $ cat file1.txt
Gold
Silver
Copper
Aluminum
Titanium
laforge@ncc1701d:~ $ cat file2.txt
Gold
Silver
Titanium
laforge@ncc1701d:~ $ grep -vf file2.txt file1.txt
Copper
Aluminum
laforge@ncc1701d:~ $ grep -f file2.txt file1.txt
Gold
Silver
Titanium
laforge@ncc1701d:~ $
Answered By - lpaseen