my-server
← Wiki

Expand (Unix)

<code>expand</code> is a shell command that converts tab characters to space characters while maintaining vertical alignment. Originally, developed for Unix and standardized by POSIX, it is available on many operating systems today. The command is available as a separate package for Windows via UnxUtils.

In the following commands, the <code>echo</code> command prints a string of text that includes a tab character, then the output is directed into <code>expand</code>. The resulting output is displayed in hexadecimal and as characters by <code>xxd</code> (dump). At the second prompt, the same <code>echo</code> output is sent directly to <code>xxd</code>. As shown, <code>expand</code> converts the tab (specified as '\t') into spaces.

See also

References

External links