Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.04 KB

comm.md

File metadata and controls

47 lines (37 loc) · 1.04 KB
title description created updated
comm Linux Command
comm Linux Command compare two sorted files line by line and write to output, It requires two sorted files which it compares line by line.
2019-08-26
2019-08-26

comm Linux Command compare two sorted files line by line and write to output, It requires two sorted files which it compares line by line.

Syntax

comm [OPTION]... FILE1 FILE2

Options

Option Description
-1 suppress printing of the first column (lines unique to the first file)
-2 suppress printing of the second column (lines unique to the second file)
-3 suppress printing of the third column (lines common to both the files)
–-check-order check's the input is correctly sorted, even if all the input lines are pairable
–-nocheck-order do not check that the input is correctly sorted
–-output-delimiter=STR separate columns with string STR

Example

$cat >file1.txt
one
two
three

$cat >file2.txt
one
three
four

$comm file1.txt file2.txt
		one
	three
	four
two
three