CUT(1)

NAME
cut - extract columns of data

SYNOPSIS
cut -b list [-n] [file ...]
cut -c list [file ...]
cut -f list [-d delim] [-s] [file ...]

DESCRIPTION
cut out bytes, characters or delimited fields from each line of file and write to stdout.

If no file is given or file is '-', cut reads from stdin.

list is a comma or space separated list of numbers and ranges starting from 1. Ranges have the form 'N-M'. If N or M is missing, beginning or end of line is assumed. Numbers and ranges may be repeated, overlapping and in any order.

Selected input is written in the same order it is read and is written exactly once.

OPTIONS

-b list | -c list
    list specifies byte | character positions.

-d delim
    Use delim as field delimiter, which can be an arbitrary string. Default is '\t'.

-f list
    list specifies field numbers. Lines not containing field delimiters are passed through, unless -s is specified.

-n  Do not split multibyte characters. A character is written when its last byte is selected.

-s  Suppress lines not containing field delimiters.

STANDARDS
The cut utility is compliant with the p1003.1-2013 specification.

The possibility of separating numbers and ranges with a space and specifying multibyte delimiters of arbitrary length is an extension to that specification.