Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (c) cut(1)
NAME
cut - Displays selected parts from each line of a le
SYNOPSIS
cut -b list [-n][le ...]
cut -c list [le ...]
cut -f list [-d character][-s][le ...]
The cut command locates the specied parts in each line of the specied le and writes the
characters in them to the standard output le.
FLAGS
-b list Cuts selections based on a list of bytes. Each selected byte is output, unless
you also specify the -n ag. For example, if you specify -b 1-72, the cut com-
mand writes out the rst 72 bytes in each line of the le.
-c list Cuts selections based on a list of characters.
-d character
Uses the specied character as the eld delimiter (separator) when you specify
the -f ag. You must quote characters with special meaning to the shell, such
as the space character. Any character can be used as character. The default
eld delimiter is a tab character.
-f list Species a list of elds assumed to be separated in the le by a eld delimiter
character, specied by the -d ag or the tab character by default. For example,
if you specify -f 1,7, the cut command writes out only the rst and seventh
elds of each line. If a line contains no eld delimiters, cut passes them
through intact (useful for table subheadings) unless you specify the -s ag.
-n Does not split characters. When specied with the -b ag, each element in list
of the form low-high (hyphen-separated numbers) is modied as follows:
If the byte selected by low is not the rst byte of a character, low is
decremented to select the rst byte of the character originally selected
by low.
If the byte selected by high is not the last byte of a character, high is
decremented to select the last byte of the character prior to the charac-
ter originally selected by high, or 0 (zero) if there is no prior character.
If the resulting range element has high equal to 0 (zero) or low greater
than high, the list element is dropped from list for that input line
without causing an error.
Each element in list of the form low- is treated as previously described with
high set to the number of bytes in the current line, not including the terminat-
ing newline character. Each element in list of the form -high is treated as pre-
viously described with low set to 1. Each element in list of the form number (a
single number) is treated as previously described with low set to number and
high set to number.
-s Suppresses lines that do not contain delimiter characters (use only with the -f
ag). Unless you include this ag, lines with no delimiters are passed through.
DESCRIPTION
If you do not specify a le or if you specify a - (dash), the cut command reads the standard input
le.
527188-004 Hewlett-Packard Company 279