Manual Reference Pages - CUT (1)
- cut out selected portions of each line of a file
[-w-| -d delim]
utility cuts out selected portions of each line (as specified by
and writes them to the standard output.
arguments are specified, or a file argument is a single dash
reads from the standard input.
The items specified by
can be in terms of column position or in terms of fields delimited
by a special character.
Column and field numbering start from 1.
is a comma or whitespace separated set of increasing numbers and/or
Number ranges consist of a number, a dash
and a second number
and select the columns or fields from the first number to the second,
Numbers or number ranges may be preceded by a dash, which selects all
columns or fields from 1 to the last number.
Numbers or number ranges may be followed by a dash, which selects all
columns or fields 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 columns or fields not present in the
The options are as follows:
specifies byte positions.
specifies character positions.
as the field delimiter character instead of the tab character.
specifies fields, separated in the input by the field delimiter character
Output fields are separated by a single occurrence of the field delimiter
Do not split multi-byte characters.
Characters will only be output if at least one byte is selected, and,
after a prefix of zero or more unselected bytes, the rest of the bytes
that form the character are selected.
Suppress lines with no field delimiter characters.
Unless specified, lines with no delimiters are passed through unmodified.
Use whitespace (spaces and tabs) as the delimiter.
Consecutive spaces and tabs count as one single field separator.
environment variables affect the execution of
as described in
Extract users login names and shells from the system
cut -d : -f 1,7 /etc/passwd
Show the names and login times of the currently logged in users:
who | cut -c 1-16,26-38
utility conforms to
command appeared in
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.