UNIQ(1,C) AIX Commands Reference UNIQ(1,C)
-------------------------------------------------------------------------------
uniq
PURPOSE
Deletes repeated lines in a file.
SYNTAX
+--------+ +----------+ +-------------------------+
uniq ---| one of |---| +------+ |---| +-----------+ |---|
| +----+ | +-| +num |-+ +- infile --| |-+
+-| -c |-+ ^| -num || +- outfile -+
| -d | |+------+|
| -u | +--------+
+----+
DESCRIPTION
The uniq command reads standard input or infile, compares adjacent lines,
removes the second and succeeding occurrences of a line, and writes to standard
output or the specified file outfile. infile and outfile should always be
different files. Repeated lines must be on consecutive lines in order to be
found. You can arrange them with the sort command (see page sort-1) before
processing.
FLAGS
-c Precedes each output line with a count of the number of times each line
appears in the file. This flag supersedes -d and -u.
-d Displays only the repeated lines.
-u Displays only the non-repeated lines.
-num Skips over the first num fields. A field is a string of nonspace, nontab
characters separated by tabs and or spaces from adjacent data on the same
line.
+num Skips over the first num characters. Fields specified by num are skipped
before characters.
RELATED INFORMATION
See the following commands: "comm" and "sort."
Processed November 8, 1990 UNIQ(1,C) 1