Skip to main content
Added an example with sort included
Source Link
Pablo A
  • 3.3k
  • 1
  • 26
  • 46

fromFrom stackoverflow...:

comm -23 file1 file2

comm -23 file1 file2

-23-23 suppresses the lines in file2 (-2-2) and the lines that appear in both (-3-3), leaving only the unique lines from file1. The files have to be sorted (they are in your example) but if not, pipesort them through sort first. With process substitution:

comm -23 <(sort file1) <(sort file2)

See the man page here

-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines in file2 (-2) and the lines that appear in both (-3), leaving only the unique lines from file1. The files have to be sorted (they are in your example) but if not, pipe them through sort first.

See the man page here

-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)

From stackoverflow:

comm -23 file1 file2

-23 suppresses the lines in file2 (-2) and the lines that appear in both (-3), leaving only the unique lines from file1. The files have to be sorted (they are in your example) but if not, sort them first. With process substitution:

comm -23 <(sort file1) <(sort file2)

See the man page here

-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)
make comment more clear. add relevant notes from man page, substitute man page for more reliable site.
Source Link
JJS
  • 531
  • 4
  • 5

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines in file2 (-2) and the lines that areappear in both files(-3), orleaving only in file 2the unique lines from file1. The files have to be sorted (they are in your example) but if not, pipe them through sort first...

See the man page herehere

-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines that are in both files, or only in file 2. The files have to be sorted (they are in your example) but if not, pipe them through sort first...

See the man page here

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines in file2 (-2) and the lines that appear in both (-3), leaving only the unique lines from file1. The files have to be sorted (they are in your example) but if not, pipe them through sort first.

See the man page here

-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

from stackoverflowstackoverflow...

comm -23 file1 file2

-23 suppresses the lines that are in both files, or only in file 2. The files have to be sorted (they are in your example) but if not, pipe them through sort first...

See the man page here

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines that are in both files, or only in file 2. The files have to be sorted (they are in your example) but if not, pipe them through sort first...

See the man page here

from stackoverflow...

comm -23 file1 file2

-23 suppresses the lines that are in both files, or only in file 2. The files have to be sorted (they are in your example) but if not, pipe them through sort first...

See the man page here

Source Link
JJS
  • 531
  • 4
  • 5
Loading