1 COMM(1) User Commands COMM(1)
2
3
4
5 NAME
6 comm - select or reject lines common to two files
7
8 SYNOPSIS
9 comm [-123] file1 file2
10
11
12 DESCRIPTION
13 The comm utility reads file1 and file2, which must be ordered in the
14 current collating sequence, and produces three text columns as output:
15 lines only in file1; lines only in file2; and lines in both files.
16
17
18 If the input files were ordered according to the collating sequence of
19 the current locale, the lines written will be in the collating sequence
20 of the original lines. If not, the results are unspecified.
21
22 OPTIONS
23 The following options are supported:
24
25 -1
26 Suppresses the output column of lines unique to file1.
27
28
29 -2
30 Suppresses the output column of lines unique to file2.
31
32
33 -3
34 Suppresses the output column of lines duplicated in file1 and
35 file2.
36
37
38 OPERANDS
39 The following operands are supported:
40
41 file1
42 A path name of the first file to be compared. If file1 is -,
43 the standard input is used.
44
45
46 file2
47 A path name of the second file to be compared. If file2 is -,
48 the standard input is used.
49
50
51 USAGE
52 See largefile(5) for the description of the behavior of comm when
53 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
54
55 EXAMPLES
56 Example 1 Printing a list of utilities specified by files
57
58
59 If file1, file2, and file3 each contain a sorted list of utilities, the
60 command
61
62
63 example% comm -23 file1 file2 | comm -23 - file3
64
65
66
67
68 prints a list of utilities in file1 not specified by either of the
69 other files. The entry:
70
71
72 example% comm -12 file1 file2 | comm -12 - file3
73
74
75
76
77 prints a list of utilities specified by all three files. And the entry:
78
79
80 example% comm -12 file2 file3 | comm -23 -file1
81
82
83
84
85 prints a list of utilities specified by both file2 and file3, but not
86 specified in file1.
87
88
89 ENVIRONMENT VARIABLES
90 See environ(5) for descriptions of the following environment variables
91 that affect the execution of comm: LANG, LC_ALL, LC_COLLATE, LC_CTYPE,
92 LC_MESSAGES, and NLSPATH.
93
94 EXIT STATUS
95 The following exit values are returned:
96
97 0
98 All input files were successfully output as specified.
99
100
101 >0
102 An error occurred.
103
104
105 ATTRIBUTES
106 See attributes(5) for descriptions of the following attributes:
107
108
109
110
111 +--------------------+-----------------+
112 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
113 +--------------------+-----------------+
114 |CSI | enabled |
115 +--------------------+-----------------+
116 |Interface Stability | Standard |
117 +--------------------+-----------------+
118
119 SEE ALSO
120 cmp(1), diff(1), sort(1), uniq(1), attributes(5), environ(5),
121 largefile(5), standards(5)
122
123
124
125 March 3, 2004 COMM(1)
|
1 COMM(1) User Commands COMM(1)
2
3 NAME
4 comm - select or reject lines common to two files
5
6 SYNOPSIS
7 comm [-123] file1 file2
8
9 DESCRIPTION
10 The comm utility reads file1 and file2, which must be ordered in the
11 current collating sequence, and produces three text columns as output:
12
13 o lines only in file1;
14
15 o lines only in file2;
16
17 o lines in both files.
18
19 If the input files were ordered according to the collating sequence of
20 the current locale, the lines written will be in the collating sequence
21 of the original lines. If not, the results are unspecified.
22
23 If either file1 or file2 is -, comm uses standard input starting at the
24 current location.
25
26 OPTIONS
27 The following options are supported:
28
29 -1 Suppresses the output column of lines unique to file1.
30
31 -2 Suppresses the output column of lines unique to file2.
32
33 -3 Suppresses the output column of lines common to both file1
34 and file2.
35
36 OPERANDS
37 The following operands are supported:
38
39 file1 A path name of the first file to be compared. If file1 is
40 -, the standard input is used.
41
42 file2 A path name of the second file to be compared. If file1 is
43 -, the standard input is used.
44
45 EXIT STATUS
46 The following exit values are returned:
47
48 0 All input files were successfully output as specified.
49
50 >0 An error occurred.
51
52 EXAMPLES
53 Example 1 Printing a list of utilities specified by files
54
55 If file1, file2, and file3 each contain a sorted list of utilities,
56 the command
57
58 $ comm -23 file1 file2 | comm -23 - file3
59
60 prints a list of utilities in file1 not specified by either of the
61 other files.
62
63 The command:
64
65 $ comm -12 file1 file2 | comm -12 - file3
66
67 prints a list of utilities specified by all three files; and the
68 command:
69
70 $ comm -12 file2 file3 | comm -23 -file1
71
72 prints a list of utilities specified by both file2 and file3, but not
73 specified in file1.
74
75 ENVIRONMENT VARIABLES
76 See environ(5) for descriptions of the following environment variables
77 that affect the execution of comm: LANG, LC_ALL, LC_COLLATE, LC_CTYPE,
78 LC_MESSAGES, LC_NUMERIC, and NLSPATH.
79
80 INTERFACE STABILITY
81 The command line interface of comm is Committed. The output of comm is
82 Committed.
83
84 SEE ALSO
85 cmp(1), diff(1), sort(1), uniq(1), attributes(5), environ(5),
86 largefile(5), standards(5)
87
88 illumos February 9, 2021 illumos
|