cut

Official Description

Displays specified parts from each line of a file.

Syntax

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

Options

-b list cuts based on a list of bytes (not available on all UNIX variants).

-c list cuts based on a list of characters.

-d delim uses the specified character as the field delimiter.

-f list specifies a list of fields assumed to be separated in the file by a field delimiter character.

-s suppresses lines that do not contain delimiter characters.

Oddities

If you do not specify a file or you specify a hyphen (-), the cut command reads standard input.

To change the order of columns in a file, use the cut and paste commands.

On Red Hat Linux, ksh93, cut is a shell built-in version ...

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.