Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
comm(1)				 User Commands			       comm(1)

NAME
       comm - select or	reject lines common to two files

SYNOPSIS
       comm [-123] file1 file2

DESCRIPTION
       The  comm utility will read file1 and file2, which should be ordered in
       the current collating sequence, and produce three text columns as  out-
       put: lines only in file1; lines only in file2; and lines	in both	files.

       If the input files were ordered according to the	collating sequence  of
       the current locale, the lines written will be in	the collating sequence
       of the original lines.  If not, the results are unspecified.

OPTIONS
       The following options are supported:

       -1    Suppress the output column	of lines unique	to file1.

       -2    Suppress the output column	of lines unique	to file2.

       -3    Suppress the output column	 of  lines  duplicated	in  file1  and
	     file2.

OPERANDS
       The following operands are supported:

       file1 A	path name of the first file to be compared. If file1 is	-, the
	     standard input is used.

       file2 A path name of the	second file to be compared. If file2 is	-, the
	     standard input is used.

USAGE
       See  largefile(5)  for  the  description	 of  the behavior of comm when
       encountering files greater than or equal	to 2 Gbyte ( 2**31 bytes).

EXAMPLES
       Example 1: Printing a list of utilities specified by files.

       If file1, file2,	and file3 each contained a sorted list of utilities:

       example%	comm -23 file1 file2  |	comm -23 - file3
       would print a list of utilities in file1	not specified by either	of the
       other files;

       example%	comm -12 file1 file2 | comm -12	- file3
       would print a list of utilities specified by all	three files; and

       example%	comm -12  file2	file3 |	comm -23 -file1
       would  print a list of utilities	specified by both file2	and file3, but
       not specified in	file1.

ENVIRONMENT VARIABLES
       See environ(5) for descriptions of the following	environment  variables
       that  affect  the execution of comm: LC_COLLATE,	LC_CTYPE, LC_MESSAGES,
       and NLSPATH.

EXIT STATUS
       The following exit values are returned:

       0     All input files were successfully output as specified.

       >0    An	error occurred.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE	TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |Availability		     |SUNWesu			   |
       +-----------------------------+-----------------------------+
       |CSI			     |enabled			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       cmp(1), diff(1),	sort(1), uniq(1),  attributes(5),  environ(5),	large-
       file(5)

SunOS 5.9			  21 Feb 1996			       comm(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | USAGE | EXAMPLES | ENVIRONMENT VARIABLES | EXIT STATUS | ATTRIBUTES | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=comm&sektion=1&manpath=SunOS+5.9>

home | help