I have two files with sorted lines. One file (B) is a subset of the other file (A). I would like to find all lines in A that ARE NOT in B. Ideally, I would like to create a file (C) that contains these lines. Is this possible in Unix? I'm looking for a one line command to do this instead of writing a script. I looked at the join
and diff
commands, but I could not find a command option to do this. Thanks for the help.
This will suppress common lines:
comm -3 a b
How about this:
grep -v -f B A > C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With