3 ms·
If I'm reading the man page correctly, the following two commands are almost equivalent? $ comm -12 file1 file2 $ fgrep -w -f file1 file2 but `comm` generali
by cauthon 5y ago
If I'm reading the man page correctly, the following two commands are almost equivalent?
$ comm -12 file1 file2
$ fgrep -w -f file1 file2
but `comm` generalizes to accommodate lines with whitespace, instead of single words? although it requires the files to be sorted.
That's actually a super useful tool to know about
- asicsp 5y agoYou can use `-x` option to compare whole lines. So `grep -Fxf` is similar to `comm -12` (this will differ if there are duplicate lines within a file)