xref: /minix3/usr.bin/comm/comm.1 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: comm.1,v 1.12 2014/04/13 01:45:34 snj Exp $
2f55b7dc8SThomas Cort.\"
3f55b7dc8SThomas Cort.\" Copyright (c) 1989, 1990, 1993
4f55b7dc8SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5f55b7dc8SThomas Cort.\"
6f55b7dc8SThomas Cort.\" This code is derived from software contributed to Berkeley by
7f55b7dc8SThomas Cort.\" the Institute of Electrical and Electronics Engineers, Inc.
8f55b7dc8SThomas Cort.\"
9f55b7dc8SThomas Cort.\" Redistribution and use in source and binary forms, with or without
10f55b7dc8SThomas Cort.\" modification, are permitted provided that the following conditions
11f55b7dc8SThomas Cort.\" are met:
12f55b7dc8SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
13f55b7dc8SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
14f55b7dc8SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
15f55b7dc8SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
16f55b7dc8SThomas Cort.\"    documentation and/or other materials provided with the distribution.
17f55b7dc8SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
18f55b7dc8SThomas Cort.\"    may be used to endorse or promote products derived from this software
19f55b7dc8SThomas Cort.\"    without specific prior written permission.
20f55b7dc8SThomas Cort.\"
21f55b7dc8SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22f55b7dc8SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23f55b7dc8SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24f55b7dc8SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25f55b7dc8SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26f55b7dc8SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27f55b7dc8SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28f55b7dc8SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29f55b7dc8SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30f55b7dc8SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31f55b7dc8SThomas Cort.\" SUCH DAMAGE.
32f55b7dc8SThomas Cort.\"
33f55b7dc8SThomas Cort.\"     @(#)comm.1	8.1 (Berkeley) 6/6/93
34f55b7dc8SThomas Cort.\"
35f55b7dc8SThomas Cort.Dd June 6, 1993
36f55b7dc8SThomas Cort.Dt COMM 1
37f55b7dc8SThomas Cort.Os
38f55b7dc8SThomas Cort.Sh NAME
39f55b7dc8SThomas Cort.Nm comm
40f55b7dc8SThomas Cort.Nd select or reject lines common to two files
41f55b7dc8SThomas Cort.Sh SYNOPSIS
42f55b7dc8SThomas Cort.Nm
43f55b7dc8SThomas Cort.Op Fl 123f
44f55b7dc8SThomas Cort.Ar file1 file2
45f55b7dc8SThomas Cort.Sh DESCRIPTION
46f55b7dc8SThomas CortThe
47f55b7dc8SThomas Cort.Nm
48f55b7dc8SThomas Cortutility reads
49f55b7dc8SThomas Cort.Ar file1
50f55b7dc8SThomas Cortand
51f55b7dc8SThomas Cort.Ar file2 ,
52f55b7dc8SThomas Cortwhich should be
53f55b7dc8SThomas Cortsorted lexically, and produces three text
54f55b7dc8SThomas Cortcolumns as output: lines only in
55f55b7dc8SThomas Cort.Ar file1 ;
56f55b7dc8SThomas Cortlines only in
57f55b7dc8SThomas Cort.Ar file2 ;
58f55b7dc8SThomas Cortand lines in both files.
59f55b7dc8SThomas Cort.Pp
60f55b7dc8SThomas CortThe filename ``-'' means the standard input.
61f55b7dc8SThomas Cort.Pp
62f55b7dc8SThomas CortThe following options are available:
63f55b7dc8SThomas Cort.Bl -tag -width Ds
64f55b7dc8SThomas Cort.It Fl 1
65f55b7dc8SThomas CortSuppress printing of column 1.
66f55b7dc8SThomas Cort.It Fl 2
67f55b7dc8SThomas CortSuppress printing of column 2.
68f55b7dc8SThomas Cort.It Fl 3
69f55b7dc8SThomas CortSuppress printing of column 3.
70f55b7dc8SThomas Cort.It Fl f
71f55b7dc8SThomas CortFold case in line comparisons.
72f55b7dc8SThomas Cort.El
73f55b7dc8SThomas Cort.Pp
74f55b7dc8SThomas CortEach column will have a number of tab characters prepended to it
75f55b7dc8SThomas Cortequal to the number of lower numbered columns that are being printed.
76f55b7dc8SThomas CortFor example, if column number two is being suppressed, lines printed
77f55b7dc8SThomas Cortin column number one will not have any tabs preceding them, and lines
78f55b7dc8SThomas Cortprinted in column number three will have one.
79f55b7dc8SThomas Cort.Pp
80f55b7dc8SThomas Cort.Nm
81f55b7dc8SThomas Cortassumes that the files are lexically sorted; all characters
82f55b7dc8SThomas Cortparticipate in line comparisons.
83f55b7dc8SThomas Cort.\" .Sh ENVIRONMENT
84f55b7dc8SThomas Cort.\" .Bl -tag -width indent
85f55b7dc8SThomas Cort.\" .It Ev LANG
86f55b7dc8SThomas Cort.\" .It Ev LC_ALL
87f55b7dc8SThomas Cort.\" .It Ev LC_CTYPE
88f55b7dc8SThomas Cort.\" .It Ev LC_COLLATE
89f55b7dc8SThomas Cort.\" .It Ev LC_MESSAGES
90f55b7dc8SThomas Cort.\" .El
91f55b7dc8SThomas Cort.Sh EXIT STATUS
92*0a6a1f1dSLionel Sambuc.Ex -std
93f55b7dc8SThomas Cort.Sh SEE ALSO
94f55b7dc8SThomas Cort.Xr cmp 1 ,
95f55b7dc8SThomas Cort.Xr diff 1 ,
96f55b7dc8SThomas Cort.Xr sort 1 ,
97f55b7dc8SThomas Cort.Xr uniq 1
98f55b7dc8SThomas Cort.Sh STANDARDS
99f55b7dc8SThomas CortThe
100f55b7dc8SThomas Cort.Nm
101f55b7dc8SThomas Cortutility conforms to
102f55b7dc8SThomas Cort.St -p1003.2-92 .
103