Samiksha Jaiswal (Editor)

Expand (Unix)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

expand is a program that converts tab characters into groups of space characters, while maintaining correct alignment. It is available in Unix operating systems and many Unix-like operating systems.

For example:

Here the echo command prints a string of text that includes a tab character, then the output is directed into the expand command. The resulting output is then displayed in hexadecimal and as characters by the xxd dump command. At the second prompt, the same echo output is sent directly to the xxd command. As can be seen by comparing the two, the expand program converts the tab (specified as ' ' to the echo program) into spaces.

References

Expand (Unix) Wikipedia