UNIQ(1) COMMAND REFERENCE UNIQ(1) NAME uniq - report repeated lines in a file SYNOPSIS uniq -{u,d,c} [ +n ] [ -n ] [input[output]] DESCRIPTION Uniq reads the input file comparing adjacent lines. The second and succeeding copies of repeated lines are removed; the remainder is written on the output file. Note that repeated lines must be adjacent in order to be found. See sort(1). If the -u flag is used, just the lines that are not repeated in the original file are output. The -d option specifies that one copy of just the repeated lines is to be written. The default output is the union of the -u and -d mode outputs. The -c option generates an output report in default style but with each line preceded by a count of the number of times it occurred. Only one of the flags u , d , or c can be used at a time. The n arguments specify skipping an initial portion of each line in the comparison. OPTIONS -c Generates a default output with each line preceded with a count of how many times it occurred. -d Only the first repeated line is output. -n The first n 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. +n The first n characters are ignored. Fields are skipped before characters. -u Repeated lines in the original file are not output. EXAMPLES Typically this command is used on previously sorted files like sorted. In the following example the output is written on a new file uniqed: uniq sorted uniqed All lines in the file uniqed will be distinct, since the input to uniq was previously sorted. Printed 5/12/88 1
UNIQ(1) COMMAND REFERENCE UNIQ(1) RETURN VALUE [NO_ERRS] Command completed without error. [USAGE] Incorrect command line syntax. Execution terminated. [P_ERR] A system error occurred. Execution terminated. See intro(2) for more information on system errors. CAVEATS Lines over 1024 characters in length will be truncated. SEE ALSO awk(1), comm(1), cut(1), egrep(1), fgrep(1), grep(1), join(1) look(1), paste(1), and sort(1). Printed 5/12/88 2
%%index%% na:240,90; sy:330,285; de:615,1140; op:1755,693; ex:2448,457; rv:3217,444; ca:3661,140; se:3801,321; %%index%%000000000134