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