plan9-uniq(1)

plan9-uniq1

Report repeated lines in a file

Usage

uniq [-udc [+-num]] [file]

Overview

Uniq copies the input file, or the standard input, to the standard output, comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed. Repeated lines must be adjacent in order to be found.

-u

Print unique lines.

-d

Print (one copy of) duplicated lines.

-c

Prefix a repetition count and a tab to each output line. Implies -u and -d.

-num

The first num fields together with any blanks before each are ignored. A field is defined as a string of non-space, non-tab characters separated by tabs and spaces from its neighbors.

+num

The first num characters are ignored. Fields are skipped before characters.

Source

/src/cmd/uniq.c

Releases

Unchanged in 2 releases since Debian 6.0 (Squeeze).

  1. 6.0–7

Bugs

Field selection and comparison should be compatible with sort(1).

From 9base 1:6-5 in Debian 7 (Wheezy). Parsed by carta from the page's man source.