.\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the Institute of Electrical and Electronics Engineers, Inc. .\" .\" %sccs.include.redist.roff% .\" .\" @(#)cut.1 8.1 (Berkeley) 06/06/93 .\" .Dd .Dt CUT 1 .Os .Sh NAME .Nm cut .Nd select portions of each line of a file .Sh SYNOPSIS .Nm cut .Fl c Ar list .Ar .Nm cut .Fl f Ar list .Op Fl d Ar string .Op Fl s .Ar .Sh DESCRIPTION The .Nm cut utility selects portions of each line (as specified by .Ar list ) from each .Ar file (or the standard input by default), and writes them to the standard output. The items specified by .Ar list can be in terms of column position or in terms of fields delimited by a special character. Column numbering starts from 1. .Pp .Ar List is a comma or whitespace separated set of increasing numbers and/or number ranges. Number ranges consist of a number, a dash .Pq Li \- , and a second number and select the fields or columns from the first number to the second, inclusive. Numbers or number ranges may be preceded by a dash, which selects all fields or columns from 1 to the first number. Numbers or number ranges may be followed by a dash, which selects all fields or columns from the last number to the end of the line. Numbers and number ranges may be repeated, overlapping, and in any order. It is not an error to select fields or columns not present in the input line. .Pp The options are as follows: .Bl -tag -width Fl .It Fl c Ar list The .Ar list specifies character positions. .It Fl d Ar string Use the first character of .Ar string as the field delimiter character instead of the tab character. .It Fl f Ar list The .Ar list specifies fields, delimited in the input by a single tab character. Output fields are separated by a single tab character. .It Fl s Suppresses lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified. .El .Pp .Nm Cut exits 0 on success, 1 if an error occurred. .Sh SEE ALSO .Xr paste 1 .Sh STANDARDS The .Nm cut utility is expected to conform to .St -p1003.2 .