Commit | Line | Data |
---|---|---|
a04b42ee | 1 | .\" @(#)uniq.1 6.1 (Berkeley) %G% |
f2028daa | 2 | .\" |
a04b42ee | 3 | .TH UNIQ 1 "" |
f2028daa KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | uniq \- report repeated lines in a file | |
7 | .SH SYNOPSIS | |
8 | .B uniq | |
9 | [ | |
10 | .B \-udc | |
11 | [ | |
12 | .BR + n | |
13 | ] [ | |
14 | .BR \- n | |
15 | ] | |
16 | ] [ input [ output ] ] | |
17 | .SH DESCRIPTION | |
18 | .I Uniq | |
d60d0b29 KM |
19 | reads the input file comparing adjacent lines. |
20 | In the normal case, the second and succeeding copies of repeated lines are | |
f2028daa | 21 | removed; the remainder is written on the output file. |
d60d0b29 | 22 | Note that repeated lines must be adjacent in order to be found; see |
f2028daa KM |
23 | .IR sort (1). |
24 | If the | |
25 | .B \-u | |
d60d0b29 KM |
26 | flag is used, just the lines that are not repeated |
27 | in the original file are output. The | |
f2028daa | 28 | .B \-d |
d60d0b29 | 29 | option specifies that one copy of just the repeated lines is to be written. |
f2028daa KM |
30 | The normal mode output is the union of the |
31 | .B \-u | |
32 | and | |
33 | .B \-d | |
34 | mode outputs. | |
35 | .PP | |
36 | The | |
37 | .B \-c | |
38 | option supersedes | |
39 | .B \-u | |
40 | and | |
41 | .B \-d | |
d60d0b29 KM |
42 | and generates an output report in default style |
43 | but with each line preceded by a count of the number of times it occurred. | |
f2028daa KM |
44 | .PP |
45 | The | |
46 | .I n | |
d60d0b29 | 47 | arguments specify skipping an initial portion of each line in the comparison: |
f2028daa KM |
48 | .TP 8 |
49 | .BI \- n | |
50 | The first | |
51 | .IR n | |
d60d0b29 | 52 | fields together with any blanks before each are ignored. |
f2028daa KM |
53 | A field is defined as a string of non-space, non-tab characters |
54 | separated by tabs and spaces from its neighbors. | |
55 | .TP 8 | |
56 | .BI + n | |
57 | The first | |
58 | .IR n | |
d60d0b29 | 59 | characters are ignored. Fields are skipped before characters. |
f2028daa KM |
60 | .PP |
61 | .SH "SEE ALSO" | |
62 | sort(1), comm(1) |