Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ uniq(1) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

comm(1)

sort(1)



uniq(1)                          DG/UX R4.11                         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 line.
       This is not a unique line.
       This line occurs once.
       The next line will not count as the third occurrence.
       This is not a unique line.
       $ uniq -c infile
          2 This is not a unique line.
          1 This line occurs once.
          1 The next line will not count as the third occurrence.
          1 This is not a unique line.

       The above example finds repeated lines in a file.  NOTE:  Only
       repeated adjacent lines are considered repeated.

SEE ALSO
       comm(1), sort(1).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026