4.3BSD-Reno/src/usr.bin/comm/comm.1

Compare this file to the similar file:
Show the results in this format:

.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement:  ``This product includes software developed by the
.\" University of California, Berkeley and its contributors'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of the University nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\"     @(#)comm.1	6.4 (Berkeley) 7/24/90
.\"
.Dd July 24, 1990
.Os BSD 4.4
.Dt COMM 1
.Sh NAME
.Nm comm
.Nd Select or reject lines common to two files
.Sh SYNOPSIS
.Nm comm
.Op Fl 123
.Ar file1 file2
.Sh DESCRIPTION
The
.Nm comm
utility reads
.Ar file1
and
.Ar file2 ,
which should be
sorted lexically, and produces three text
columns as output: lines only in
.Ar file1 ;
lines only in
.Ar file2 ;
and lines in both files.
.Pp
The filename
.Sq Fl
means the standard input.
.Pp
The following options are available:
.Tw Ds
.Tp Fl 1
Suppress printing of column 1.
.Tp Fl 2
Suppress printing of column 2.
.Tp Fl 3
Suppress printing of column 3.
.Tp
.Pp
Each column will have a number of tab characters prepended to it
equal to the number of lower numbered columns that are being printed.
For example, if column number two is being suppressed, lines printed
in column number one will not have any tabs preceding them, and lines
printed in column number three will have one.
.Pp
.Nm Comm
assumes that the files are lexically sorted; all characters
participate in line comparisons.
.Pp
.Nm Comm
exits 0 on success, >0 if an error occurred.
.Sh SEE ALSO
.Xr cmp 1 ,
.Xr diff 1 ,
.Xr sort 1 ,
.Xr uniq 1
.Sh STANDARDS
The
.Nm comm
function is expected to be POSIX 1003.2 compatible.