comm(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

comm(1)

comm(1)                          User Commands                         comm(1)

NAME
       comm - select or reject lines common to two files

SYNOPSIS
       /usr/bin/comm [-123] [--check-order|--nocheck-order]
            [--output-delimiter=STR] [--help] file1 file2

DESCRIPTION
       comm  reads  two files, file1 and file2, which should be ordered in the
       collating sequence of the  current  locale,  and  produces  three  text
       columns as output:

       1    Lines only in file1.


       2    Lines only in file2.


       3    Lines in both files.



       If  lines in either file are not ordered according to the collating se‐
       quence of the current locale, the behavior is dependent  on  the  order
       option specified:

       --nocheck-order    No error will be raised about the sort order. Output
                          will be invalid.


       --check-order      If any line in either file1 or file2 does not appear
                          in  sorted  order an error will occur, regardless of
                          whether the line if file1 matches the  corresponding
                          line in file2.



       If  no  order option is specified, the default behavior is not to check
       the sort order of the  input.  This  is  identical  to  specifying  the
       --nocheck-order option.


       If either file1 or file2 is -, comm uses standard input starting at the
       current location.

OPTIONS
       The following options are supported:

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


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


       -3                        Suppresses  the output column of lines dupli‐
                                 cated in file1 and file2.


       --check-order             Check that the  input  is  correctly  sorted,
                                 even  if  all lines in file1 are matched with
                                 their corresponding line in file2.


       --nocheck-order           Do not check  that  the  input  is  correctly
                                 sorted. This is the default behavior.


       --output-delimiter=STR    Separate columns with STR.


       --help                    Display command usage and exit.


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.


EXAMPLES
       Example 1 Printing a list of utilities specified by files



       If file1, file2, and file3 each contain a sorted list of utilities, the
       command


         example% comm -23 file1 file2 | comm -23 - file3




       prints  a  list  of  utilities  in file1 not specified by either of the
       other files. The entry:


         example% comm -12 file1 file2 | comm -12 - file3




       prints a list of utilities specified by all three files. And the entry:


         example% comm -12 file2 file3 | comm -23 -file1




       prints a list of utilities specified by both file2 and  file3, but  not
       specified in file1.

ENVIRONMENT VARIABLES
       See  environ(7) for descriptions of the following environment variables
       that affect the execution of comm: LANG, LC_ALL, 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(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os  _  CSIEnabled  _  Interface
       StabilityCommitted _ StandardSee standards(7).


SEE ALSO
       cmp(1),  diff(1),  sort(1),  uniq(1),  attributes(7), environ(7), stan‐
       dards(7)

Oracle Solaris 11.4               29 Nov 2022                          comm(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3