UNIQ(1) COMMAND REFERENCE UNIQ(1)
NAME
uniq - report repeated lines in a file
SYNOPSIS
uniq -{u,d,c} [ +n ] [ -n ] [input[output]]
DESCRIPTION
Uniq reads the input file comparing adjacent lines. The
second and succeeding copies of repeated lines are removed;
the remainder is written on the output file. Note that
repeated lines must be adjacent in order to be found. See
sort(1). If the -u flag is used, just the lines that are
not repeated in the original file are output. The -d option
specifies that one copy of just the repeated lines is to be
written. The default output is the union of the -u and -d
mode outputs.
The -c option generates an output report in default style
but with each line preceded by a count of the number of
times it occurred.
Only one of the flags u , d , or c can be used at a time.
The n arguments specify skipping an initial portion of each
line in the comparison.
OPTIONS
-c Generates a default output with each line preceded with
a count of how many times it occurred.
-d Only the first repeated line is output.
-n The first n fields together with any blanks before each
are ignored. A field is defined as a string of
nonspace, nontab characters separated by tabs and spaces
from its neighbors.
+n The first n characters are ignored. Fields are skipped
before characters.
-u Repeated lines in the original file are not output.
EXAMPLES
Typically this command is used on previously sorted files
like sorted. In the following example the output is written
on a new file uniqed:
uniq sorted uniqed
Printed 10/17/86 1
UNIQ(1) COMMAND REFERENCE UNIQ(1)
All lines in the file uniqed will be distinct, since the
input to uniq was previously sorted.
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[P_ERR] A system error occurred. Execution
terminated. See intro(2) for more
information on system errors.
CAVEATS
Lines over 1024 characters in length will be truncated.
SEE ALSO
awk(1), comm(1), cut(1), egrep(1), fgrep(1), grep(1),
join(1) look(1), paste(1), sort(1).
Printed 10/17/86 2
%%index%%
na:72,74;
sy:146,205;
de:351,1028;
op:1379,643;
ex:2022,271;2437,141;
rv:2578,400;
ca:2978,112;
se:3090,286;
%%index%%000000000142