Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/uniq/uniq.1
Show All 25 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 | .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 1, 2018 | .Dd December 15, 2019 | ||||
.Dt UNIQ 1 | .Dt UNIQ 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm uniq | .Nm uniq | ||||
.Nd report or filter out repeated lines in a file | .Nd report or filter out repeated lines in a file | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl c | .Op Fl c | Fl d | Fl D | Fl u | ||||
.Op Fl d | Fl u | |||||
.Op Fl i | .Op Fl i | ||||
.Op Fl f Ar num | .Op Fl f Ar num | ||||
.Op Fl s Ar chars | .Op Fl s Ar chars | ||||
.Oo | .Oo | ||||
.Ar input_file | .Ar input_file | ||||
.Op Ar output_file | .Op Ar output_file | ||||
.Oc | .Oc | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
Show All 18 Lines | |||||
so it may be necessary to sort the files first. | so it may be necessary to sort the files first. | ||||
.Pp | .Pp | ||||
The following options are available: | The following options are available: | ||||
.Bl -tag -width Ds | .Bl -tag -width Ds | ||||
.It Fl c , Fl -count | .It Fl c , Fl -count | ||||
Precede each output line with the count of the number of times the line | Precede each output line with the count of the number of times the line | ||||
occurred in the input, followed by a single space. | occurred in the input, followed by a single space. | ||||
.It Fl d , Fl -repeated | .It Fl d , Fl -repeated | ||||
Only output lines that are repeated in the input. | Output a single copy of each line that is repeated in the input. | ||||
.It Fl D , Fl -all-repeated Op Ar septype | |||||
Output all lines that are repeated (like | |||||
.Fl d , | |||||
but each copy of the repeated line is written). | |||||
The optional | |||||
.Ar septype | |||||
argument controls how to separate groups of repeated lines in the output; | |||||
it must be one of the following values: | |||||
.Pp | |||||
.Bl -tag -compact -width separate | |||||
.It none | |||||
Do not separate groups of lines (this is the default). | |||||
.It prepend | |||||
Output an empty line before each group of lines. | |||||
.It separate | |||||
Output an empty line after each group of lines. | |||||
.El | |||||
.It Fl f Ar num , Fl -skip-fields Ar num | .It Fl f Ar num , Fl -skip-fields Ar num | ||||
Ignore the first | Ignore the first | ||||
.Ar num | .Ar num | ||||
fields in each input line when doing comparisons. | fields in each input line when doing comparisons. | ||||
A field is a string of non-blank characters separated from adjacent fields | A field is a string of non-blank characters separated from adjacent fields | ||||
by blanks. | by blanks. | ||||
Field numbers are one based, i.e., the first field is field one. | Field numbers are one based, i.e., the first field is field one. | ||||
.It Fl i , Fl -ignore-case | .It Fl i , Fl -ignore-case | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |