Bash remove part of a file based on contents of another file
I have file x and file y. File y contains a lot of text, including the contents of file x (at some point, the command cat x >> y had been issued). Is there a quick and easy way to reverse this? Basically this means removing from file y, the part that matches the exact contents of file x?
For example, if file y contains:
a
b
c
d
e
f
d
c
and file x contains:
c
d
then the desired output would be file y containing:
a
b
e
f
d
c
|