uniq(1) DG/UX 5.4R3.00 uniq(1)
NAME
uniq - report repeated lines in a file
SYNOPSIS
uniq [ -udc [ +n ] [ -n ] ] [input [output ] ]
DESCRIPTION
Uniq reads the input file comparing adjacent lines. In the normal
case, the second and succeeding copies of repeated lines are removed;
the remainder is written on the output file. Input and output should
always be different. Note that repeated lines must be adjacent in
order to be found; see sort(1).
International Features
uniq can process characters from supplementary code sets.
OPTIONS
-u Output just the lines that are not repeated in the original
file.
-d Writes one copy of just the repeated lines. The normal mode
output is the union of the -u and -d mode outputs.
-c Ignore the -u and -d options and generate an output report in
default style, but precede each line with the number of times
the line occurred.
The n arguments specify skipping an initial portion of each line in
the comparison:
-n The first n fields, together with any blanks before each, are
ignored. A field is a string of non-space, non-tab characters
separated by tabs and spaces from its neighbors.
+n The first n characters are ignored. Fields are skipped before
characters.
International Features
+n n must be in columns, not in characters.
EXAMPLES
$ cat infile
This is not a unique file.
This is not a unique file.
This line occurs once.
The next line will not count as the third occurrence.
This is not a unique file.
$ uniq -c infile
2 This is not a unique file.
1 This line occurs once.
1 The next line will not count as the third occurrence.
1 This is not a unique file.
The above example finds repeated lines in a file. NOTE: Only
Licensed material--property of copyright holder(s) 1
uniq(1) DG/UX 5.4R3.00 uniq(1)
repeated adjacent lines are considered repeated.
SEE ALSO
comm(1), sort(1).
Licensed material--property of copyright holder(s) 2