Name

expand

Synopsis

    expand [options] [files]

Expand tab characters into appropriate number of spaces. expand reads the named files or standard input if no files are provided. See also unexpand.

Options

- n

Set the tabstops every n characters. The default is 8.

- tablist

Interpret tabs according to tablist, a space- or comma-separated list of numbers in ascending order, that describe the “tabstops” for the input data.

-i, --initial

Convert tabs only at the beginning of lines.

-ttablist, --tabstablist

Interpret tabs according to tablist, a space- or comma-separated list of numbers in ascending order, that describe the “tabstops” for the input data.

Example

Cut columns 10-12 of the input data, even when tabs are used:

    expand data | cut -c 10-12 > data.col2

Get Unix in a Nutshell, 4th Edition 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.