Scroll to navigation

EXPAND(1) General Commands Manual EXPAND(1)

NAME

expand - Convert tabs in each FILE to spaces, writing to standard output. With no FILE, or when FILE is -, read standard input.

SYNOPSIS

expand [-i|--initial] [-t|--tabs] [-U|--no-utf8] [-h|--help] [-V|--version] [FILES]

DESCRIPTION

Convert tabs in each FILE to spaces, writing to standard output. With no FILE, or when FILE is -, read standard input.

OPTIONS

do not convert tabs after non blanks
have tabs N characters apart, not 8 or use comma separated list of explicit tab positions
interpret input file as 8-bit ASCII rather than UTF-8
Print help
Print version

VERSION

v(uutils coreutils) 0.9.0

EXAMPLES

Convert tabs in each file to spaces, writing to `stdout`:

expand path/to/file

Convert tabs to spaces, reading from `stdin`:

expand

Do not convert tabs after non blanks:

expand [-i|--initial] path/to/file

Have tabs a certain number of characters apart, not 8:

expand [-t|--tabs] number path/to/file

Use a comma separated list of explicit tab positions:

expand [-t|--tabs] 1,4,6

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

2026-06-04