[BACK]Return to uniq.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / uniq

Annotation of src/usr.bin/uniq/uniq.1, Revision 1.11

1.11    ! jmc         1: .\"    $OpenBSD: uniq.1,v 1.10 2004/08/10 22:32:05 jmc Exp $
1.1       deraadt     2: .\"    $NetBSD: uniq.1,v 1.5 1994/12/06 07:51:15 jtc Exp $
                      3: .\"
                      4: .\" Copyright (c) 1991, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" This code is derived from software contributed to Berkeley by
                      8: .\" the Institute of Electrical and Electronics Engineers, Inc.
                      9: .\"
                     10: .\" Redistribution and use in source and binary forms, with or without
                     11: .\" modification, are permitted provided that the following conditions
                     12: .\" are met:
                     13: .\" 1. Redistributions of source code must retain the above copyright
                     14: .\"    notice, this list of conditions and the following disclaimer.
                     15: .\" 2. Redistributions in binary form must reproduce the above copyright
                     16: .\"    notice, this list of conditions and the following disclaimer in the
                     17: .\"    documentation and/or other materials provided with the distribution.
1.8       millert    18: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    19: .\"    may be used to endorse or promote products derived from this software
                     20: .\"    without specific prior written permission.
                     21: .\"
                     22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32: .\" SUCH DAMAGE.
                     33: .\"
                     34: .\"     @(#)uniq.1     8.1 (Berkeley) 6/6/93
                     35: .\"
1.6       millert    36: .Dd December 8, 2002
1.1       deraadt    37: .Dt UNIQ 1
                     38: .Os
                     39: .Sh NAME
                     40: .Nm uniq
                     41: .Nd report or filter out repeated lines in a file
                     42: .Sh SYNOPSIS
                     43: .Nm uniq
1.10      jmc        44: .Op Fl c | d | u
1.1       deraadt    45: .Op Fl f Ar fields
                     46: .Op Fl s Ar chars
                     47: .Oo
                     48: .Ar input_file
                     49: .Op Ar output_file
                     50: .Oc
                     51: .Sh DESCRIPTION
                     52: The
1.5       aaron      53: .Nm
1.3       aaron      54: utility reads the standard input comparing adjacent lines and writes
1.1       deraadt    55: a copy of each unique input line to the standard output.
                     56: The second and succeeding copies of identical adjacent input lines are
                     57: not written.
                     58: Repeated lines in the input will not be detected if they are not adjacent,
                     59: so it may be necessary to sort the files first.
                     60: .Pp
1.4       aaron      61: The options are as follows:
1.1       deraadt    62: .Bl -tag -width Ds
                     63: .It Fl c
                     64: Precede each output line with the count of the number of times the line
                     65: occurred in the input, followed by a single space.
                     66: .It Fl d
1.10      jmc        67: Only output lines which have duplicates.
1.1       deraadt    68: .It Fl f Ar fields
                     69: Ignore the first
                     70: .Ar fields
                     71: in each input line when doing comparisons.
                     72: A field is a string of non-blank characters separated from adjacent fields
                     73: by blanks.
1.5       aaron      74: Field numbers are one based, i.e., the first field is field one.
1.1       deraadt    75: .It Fl s Ar chars
                     76: Ignore the first
                     77: .Ar chars
                     78: characters in each input line when doing comparisons.
                     79: If specified in conjunction with the
                     80: .Fl f
                     81: option, the first
                     82: .Ar chars
                     83: characters after the first
                     84: .Ar fields
                     85: fields will be ignored.
1.5       aaron      86: Character numbers are one based, i.e., the first character is character one.
1.1       deraadt    87: .It Fl u
1.10      jmc        88: Only output lines which are unique.
1.1       deraadt    89: .\".It Fl Ns Ar n
                     90: .\"(Deprecated; replaced by
                     91: .\".Fl f ) .
                     92: .\"Ignore the first n
                     93: .\"fields on each input line when doing comparisons,
                     94: .\"where n is a number.
                     95: .\"A field is a string of non-blank
                     96: .\"characters separated from adjacent fields
                     97: .\"by blanks.
                     98: .\".It Cm \&\(pl Ns Ar n
                     99: .\"(Deprecated; replaced by
                    100: .\".Fl s ) .
                    101: .\"Ignore the first
                    102: .\".Ar m
                    103: .\"characters when doing comparisons, where
                    104: .\".Ar m
                    105: .\"is a
                    106: .\"number.
                    107: .El
                    108: .Pp
                    109: If additional arguments are specified on the command line, the first
                    110: such argument is used as the name of an input file, the second is used
                    111: as the name of an output file.
1.6       millert   112: A file name of
                    113: .Ql -
1.7       hugh      114: denotes the standard input or the standard output
                    115: .Pq depending on its position on the command line .
1.1       deraadt   116: .Pp
                    117: The
1.5       aaron     118: .Nm
1.10      jmc       119: utility exits 0 on success or \*(Gt0 if an error occurred.
1.5       aaron     120: .Sh SEE ALSO
                    121: .Xr sort 1
1.9       jmc       122: .Sh STANDARDS
1.11    ! jmc       123: The
        !           124: .Nm
        !           125: utility is compliant with the
        !           126: .St -p1003.1-2004
        !           127: specification.
        !           128: .Pp
1.1       deraadt   129: The historic
1.10      jmc       130: .Cm + Ns Ar number
1.1       deraadt   131: and
                    132: .Fl Ns Ar number
                    133: options have been deprecated but are still supported in this implementation.