[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.4

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