Commit | Line | Data |
---|---|---|
a6d8385c KB |
1 | .\" Copyright (c) 1989 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms are permitted | |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)comm.1 6.2 (Berkeley) %G% | |
d3b83d9f | 17 | .\" |
daa8094e | 18 | .TH COMM 1 "" |
d3b83d9f | 19 | .SH NAME |
a6d8385c | 20 | comm - select or reject lines common to two files |
d3b83d9f | 21 | .SH SYNOPSIS |
a6d8385c | 22 | \fBcomm [ \fI-123\fP ] [ \fI-\fP ] file1 file2 |
d3b83d9f | 23 | .SH DESCRIPTION |
a6d8385c KB |
24 | The |
25 | .I comm | |
26 | utility reads | |
d3b83d9f KM |
27 | .I file1 |
28 | and | |
a6d8385c KB |
29 | .I file2 |
30 | and produces a three-column output: lines only in | |
31 | .IR file1 , | |
d3b83d9f | 32 | lines only in |
a6d8385c | 33 | .IR file2 , |
d3b83d9f | 34 | and lines in both files. |
d3b83d9f | 35 | .PP |
a6d8385c KB |
36 | The filename ``-'' means the standard input. |
37 | .PP | |
38 | The following options are available: | |
39 | .TP | |
40 | -1 | |
41 | Suppress printing of column 1. | |
42 | .TP | |
43 | -2 | |
44 | Suppress printing of column 2. | |
45 | .TP | |
46 | -3 | |
47 | Suppress printing of column 3. | |
d3b83d9f | 48 | .PP |
a6d8385c KB |
49 | Each column will have a number of tab characters prepended to it |
50 | equal to the number of lower numbered columns that are being printed. | |
51 | For example, if column number two is being suppressed, lines printed | |
52 | in column number one will not have any tabs preceding them, and lines | |
53 | printed in column number three will have one. | |
54 | .PP | |
55 | .I Comm | |
56 | assumes that the files are lexically sorted; all characters | |
57 | participate in line comparisons. | |
58 | .PP | |
59 | .I Comm | |
60 | exits 0 on success, >0 if an error occurred. | |
d3b83d9f | 61 | .SH "SEE ALSO" |
a6d8385c | 62 | cmp(1), diff(1), sort(1), uniq(1) |