uniq(1) uniq(1)NAME uniq - reports repeated lines in a file SYNOPSIS uniq [-c] [-d] [+num] [-num] [-u] [infile [outfile]] ARGUMENTS -c Supersedes the -u and -d option and generates an output report in default style but with each line preceded by a count of the number of times it occurred. -d Writes one copy of just the repeated lines. The normal mode output is the union of the -u and -d mode outputs. infile Specifies the input file that uniq is going to read. +num The first num characters are ignored. Fields are skipped before characters. -num The first num fields together with any blanks before each are ignored. A field is defined as a string of nonspace, nontab characters separated by tabs and spaces from its neighbors. outfile Specifies the output file into which the repeated lines will be written. -u Outputs only the lines that are not repeated in the original file. 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 in the output file. infile and outfile should always be different. Note that repeated lines must be adjacent in order to be found; see sort(1). EXAMPLES To print the contents of file1 with adjacent identical lines removed, enter: uniq file1 FILES /usr/bin/uniq Executable file January 1992 1
uniq(1) uniq(1)SEE ALSO comm(1), diff(1), sort(1) 2 January 1992