Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


uniq                         Command                         uniq




Remove/count repeated lines in a sorted file

uniq [-cdu] [-n] [+n] [infile[outfile]]

uniq reads  input line  by line from  infile and writes  all non-
duplicated  lines to  outfile.  The  input  file must  be sorted.
uniq uses  the standard input or output if  either infile or out-
file is omitted.  The following describes the available options:

-c    Print each  line once,  discarding duplicate  lines; before
     each line,  print the number of times  it appears within the
     file.

-d   Print only lines  that are duplicated within the file; print
     each line only once; do not print any counts.

-u   Print only lines that are not duplicated within the file.

uniq by default  behaves as if both -u and  -d were specified, so
it prints each unique line once.

Optional specifiers  allow uniq to  skip leading portions  of the
input lines when comparing for uniqueness.

-n   Skip n fields of each  input line, where a field is any num-
     ber of  non-white space characters surrounded  by any number
     of white space characters (blank or tab).

+n   Skip n characters  in each input line, after skipping fields
     as above.

***** See Also *****

comm, commands, sort






















COHERENT Lexicon                                           Page 1


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