from Case Larsen <laba-2ho@WEB.berkeley.edu>
[unix-history] / usr / src / usr.bin / comm / comm.1
CommitLineData
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 20comm - 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
24The
25.I comm
26utility reads
d3b83d9f
KM
27.I file1
28and
a6d8385c
KB
29.I file2
30and produces a three-column output: lines only in
31.IR file1 ,
d3b83d9f 32lines only in
a6d8385c 33.IR file2 ,
d3b83d9f 34and lines in both files.
d3b83d9f 35.PP
a6d8385c
KB
36The filename ``-'' means the standard input.
37.PP
38The following options are available:
39.TP
40-1
41Suppress printing of column 1.
42.TP
43-2
44Suppress printing of column 2.
45.TP
46-3
47Suppress printing of column 3.
d3b83d9f 48.PP
a6d8385c
KB
49Each column will have a number of tab characters prepended to it
50equal to the number of lower numbered columns that are being printed.
51For example, if column number two is being suppressed, lines printed
52in column number one will not have any tabs preceding them, and lines
53printed in column number three will have one.
54.PP
55.I Comm
56assumes that the files are lexically sorted; all characters
57participate in line comparisons.
58.PP
59.I Comm
60exits 0 on success, >0 if an error occurred.
d3b83d9f 61.SH "SEE ALSO"
a6d8385c 62cmp(1), diff(1), sort(1), uniq(1)