cut

QNX SDP8.0Utilities ReferenceUtilities

Print selected fields of each line of a file to standard output (POSIX, toybox)

Syntax:

cut [-Ds] [-bcCfF list] [-dO delim] [file...]

Runs on:

QNX OS

Options:

-b list
Select bytes.
-C list
Select Unicode columns.
-c list
Select UTF-8 characters.
-D
Don't sort and collate selections or match lines specified by -f or -F without a delimiter.
-d delim
Use delim as the delimiter character (default is a tab character for -f, run of whitespace for -F.)
-F list
Select fields separated by a delim regular expression.
-f list
Select fields (words) separated by a single delim character.
-O delim
Output delimiter (default one space for -F, input delim for -f.)
-s
Skip lines that don't have delimiters.
file
The pathname of a text file, whose contents are used instead of the standard input.

Description:

For every file you name, the cut utility cuts out columns or fields from each line, concatenates them, and writes them to standard output.

Each selection list is comma separated, either by numbers (starting from one) or by dash-separated ranges (with X- marking the end of the line, and -X marking the start.) Use -D to prevent selection ranges from being sorted and collated (this is done by default).

This utility is provided as part of the toybox package. For information on how to enable it, see toybox.

Contributing author:

Rob Landley and the toybox project (see https://landley.net/toybox/).

Page updated: