-
Notifications
You must be signed in to change notification settings - Fork 3
/
uniq.text
60 lines (45 loc) · 2.84 KB
/
uniq.text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
UNIQ(1) BSD General Commands Manual UNIQ(1)
NNAAMMEE
uunniiqq -- report or filter out repeated lines in a file
SSYYNNOOPPSSIISS
uunniiqq [--cc | --dd | --uu] [--ii] [--ff _n_u_m] [--ss _c_h_a_r_s] [_i_n_p_u_t___f_i_l_e [_o_u_t_p_u_t___f_i_l_e]]
DDEESSCCRRIIPPTTIIOONN
The uunniiqq utility reads the specified _i_n_p_u_t___f_i_l_e comparing adjacent lines,
and writes a copy of each unique input line to the _o_u_t_p_u_t___f_i_l_e. If
_i_n_p_u_t___f_i_l_e is a single dash (`--') or absent, the standard input is read.
If _o_u_t_p_u_t___f_i_l_e is absent, standard output is used for output. The second
and succeeding copies of identical adjacent input lines are not written.
Repeated lines in the input will not be detected if they are not adja-
cent, so it may be necessary to sort the files first.
The following options are available:
--cc Precede each output line with the count of the number of times
the line occurred in the input, followed by a single space.
--dd Only output lines that are repeated in the input.
--ff _n_u_m Ignore the first _n_u_m fields in each input line when doing compar-
isons. A field is a string of non-blank characters separated
from adjacent fields by blanks. Field numbers are one based,
i.e., the first field is field one.
--ss _c_h_a_r_s
Ignore the first _c_h_a_r_s characters in each input line when doing
comparisons. If specified in conjunction with the --ff option, the
first _c_h_a_r_s characters after the first _n_u_m fields will be
ignored. Character numbers are one based, i.e., the first char-
acter is character one.
--uu Only output lines that are not repeated in the input.
--ii Case insensitive comparison of lines.
EENNVVIIRROONNMMEENNTT
The LANG, LC_ALL, LC_COLLATE and LC_CTYPE environment variables affect
the execution of uunniiqq as described in environ(7).
EEXXIITT SSTTAATTUUSS
The uunniiqq utility exits 0 on success, and >0 if an error occurs.
CCOOMMPPAATTIIBBIILLIITTYY
The historic ++_n_u_m_b_e_r and --_n_u_m_b_e_r options have been deprecated but are
still supported in this implementation.
SSEEEE AALLSSOO
sort(1)
SSTTAANNDDAARRDDSS
The uunniiqq utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as
amended by Cor. 1-2002.
HHIISSTTOORRYY
A uunniiqq command appeared in Version 3 AT&T UNIX.
BSD July 3, 2004 BSD