Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1989, 1990 The Regents of the University of California. |
a6d8385c KB |
2 | .\" All rights reserved. |
3 | .\" | |
b5dc1377 | 4 | .\" %sccs.include.redist.man% |
a6d8385c | 5 | .\" |
0e853b88 | 6 | .\" @(#)comm.1 6.5 (Berkeley) %G% |
d3b83d9f | 7 | .\" |
b5dc1377 | 8 | .Dd |
0e853b88 | 9 | .Os |
b5dc1377 CL |
10 | .Dt COMM 1 |
11 | .Sh NAME | |
12 | .Nm comm | |
13 | .Nd select or reject lines common to two files | |
14 | .Sh SYNOPSIS | |
15 | .Nm comm | |
16 | .Op Fl 123 | |
17 | .Ar file1 file2 | |
18 | .Sh DESCRIPTION | |
a6d8385c | 19 | The |
b5dc1377 | 20 | .Nm comm |
a6d8385c | 21 | utility reads |
b5dc1377 | 22 | .Ar file1 |
d3b83d9f | 23 | and |
b5dc1377 CL |
24 | .Ar file2 , |
25 | which should be | |
26 | sorted lexically, and produces three text | |
27 | columns as output: lines only in | |
28 | .Ar file1 ; | |
d3b83d9f | 29 | lines only in |
b5dc1377 | 30 | .Ar file2 ; |
d3b83d9f | 31 | and lines in both files. |
b5dc1377 | 32 | .Pp |
5325ced3 | 33 | The filename |
0e853b88 | 34 | .Ql Fl |
5325ced3 | 35 | means the standard input. |
b5dc1377 | 36 | .Pp |
a6d8385c | 37 | The following options are available: |
0e853b88 CL |
38 | .Bl -tag -width Ds |
39 | .It Fl 1 | |
a6d8385c | 40 | Suppress printing of column 1. |
0e853b88 | 41 | .It Fl 2 |
a6d8385c | 42 | Suppress printing of column 2. |
0e853b88 | 43 | .It Fl 3 |
a6d8385c | 44 | Suppress printing of column 3. |
0e853b88 | 45 | .El |
b5dc1377 | 46 | .Pp |
a6d8385c KB |
47 | Each column will have a number of tab characters prepended to it |
48 | equal to the number of lower numbered columns that are being printed. | |
49 | For example, if column number two is being suppressed, lines printed | |
50 | in column number one will not have any tabs preceding them, and lines | |
51 | printed in column number three will have one. | |
b5dc1377 CL |
52 | .Pp |
53 | .Nm Comm | |
a6d8385c KB |
54 | assumes that the files are lexically sorted; all characters |
55 | participate in line comparisons. | |
b5dc1377 CL |
56 | .Pp |
57 | .Nm Comm | |
a6d8385c | 58 | exits 0 on success, >0 if an error occurred. |
b5dc1377 CL |
59 | .Sh SEE ALSO |
60 | .Xr cmp 1 , | |
61 | .Xr diff 1 , | |
62 | .Xr sort 1 , | |
63 | .Xr uniq 1 | |
64 | .Sh STANDARDS | |
65 | The | |
66 | .Nm comm | |
0e853b88 | 67 | command is expected to be POSIX 1003.2 compatible. |