don't bother resolving onbld python module deps
[unleashed.git] / bin / uniq / uniq.1
blobaffd478612eb7fd312f0b98a2dfa3dbcc3d8ab7f
1 .\"     $OpenBSD: uniq.1,v 1.21 2017/12/23 00:52:33 schwarze Exp $
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. Neither the name of the University nor the names of its contributors
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 .\"
36 .Dd $Mdocdate: December 23 2017 $
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
44 .Op Fl ci
45 .Op Fl d | u
46 .Op Fl f Ar fields
47 .Op Fl s Ar chars
48 .Oo
49 .Ar input_file
50 .Op Ar output_file
51 .Oc
52 .Sh DESCRIPTION
53 The
54 .Nm
55 utility reads the standard input comparing adjacent lines and writes
56 a copy of each unique input line to the standard output.
57 The second and succeeding copies of identical adjacent input lines are
58 not written.
59 Repeated lines in the input will not be detected if they are not adjacent,
60 so it may be necessary to sort the files first.
61 .Pp
62 The options are as follows:
63 .Bl -tag -width Ds
64 .It Fl c
65 Precede each output line with the count of the number of times the line
66 occurred in the input, followed by a single space.
67 .It Fl d
68 Only output lines which have duplicates.
69 .It Fl f Ar fields
70 Ignore the first
71 .Ar fields
72 in each input line when doing comparisons.
73 A field is a string of non-blank characters separated from adjacent fields
74 by blanks, with blanks considered part of the following field.
75 Field numbers are one based, i.e., the first field is field one.
76 .It Fl i
77 Regard lower and upper case ASCII characters as identical.
78 .It Fl s Ar chars
79 Ignore the first
80 .Ar chars
81 characters in each input line when doing comparisons.
82 If specified in conjunction with the
83 .Fl f
84 option, the first
85 .Ar chars
86 characters after the first
87 .Ar fields
88 fields will be ignored.
89 Character numbers are one based, i.e., the first character is character one.
90 .It Fl u
91 Only output lines which are unique.
92 .\".It Fl Ns Ar n
93 .\"(Deprecated; replaced by
94 .\".Fl f ) .
95 .\"Ignore the first n
96 .\"fields on each input line when doing comparisons,
97 .\"where n is a number.
98 .\"A field is a string of non-blank
99 .\"characters separated from adjacent fields
100 .\"by blanks.
101 .\".It Cm \&\(pl Ns Ar n
102 .\"(Deprecated; replaced by
103 .\".Fl s ) .
104 .\"Ignore the first
105 .\".Ar m
106 .\"characters when doing comparisons, where
107 .\".Ar m
108 .\"is a
109 .\"number.
112 If additional arguments are specified on the command line, the first
113 such argument is used as the name of an input file, the second is used
114 as the name of an output file.
115 A file name of
116 .Ql -
117 denotes the standard input or the standard output
118 .Pq depending on its position on the command line .
119 .Sh ENVIRONMENT
120 .Bl -tag -width LC_CTYPE
121 .It Ev LC_CTYPE
122 The character encoding
123 .Xr locale 1 .
124 It decides which byte sequences form characters
125 and which characters are considered blank.
126 If unset or set to
127 .Qq C ,
128 .Qq POSIX ,
129 or an unsupported value, each byte is treated as a character,
130 and only space and tab are considered blank.
132 This variable is ignored for case comparisons.
133 Lower and upper case versions of non-ASCII characters are always
134 considered different.
136 .Sh EXIT STATUS
137 .Ex -std uniq
138 .Sh SEE ALSO
139 .Xr sort 1
140 .Sh STANDARDS
143 utility is compliant with the
144 .St -p1003.1-2008
145 specification.
148 .Fl i
149 option and the use of
150 .Fl c
151 in conjunction with
152 .Fl d
154 .Fl u
155 are extensions to that specification.
157 The historic
158 .Cm + Ns Ar number
160 .Fl Ns Ar number
161 options have been deprecated but are still supported in this implementation.