In this article, we will explore the fascinating world of Expand (Unix) and everything it has to offer. From its origins to its impact on today's society, through its applications in different fields, Expand (Unix) has been an object of interest and study for a long time. Throughout the pages that follow, we will thoroughly analyze all aspects related to Expand (Unix), providing a complete and detailed vision that allows us to better understand its importance and influence on our daily lives. Join us on this tour of Expand (Unix) and discover everything this theme has to offer.
This article needs additional citations for verification. (July 2009) |
| expand | |
|---|---|
| Operating system | Unix and Unix-like |
| Platform | Cross-platform |
| Type | Command |
expand 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.[1] The command is available as a separate package for Windows via UnxUtils.[2]
In the following commands, the echo command prints a string of text that includes a tab character, then the output is directed into expand. The resulting output is displayed in hexadecimal and as characters by xxd (dump). At the second prompt, the same echo output is sent directly to xxd. As shown, expand converts the tab (specified as '\t') into spaces.
$ echo -e "foo\tbar" | expand | xxd -g 1 -u
0000000: 66 6F 6F 20 20 20 20 20 62 61 72 0A foo bar.
$ echo -e "foo\tbar" | xxd -g 1 -u
0000000: 66 6F 6F 09 62 61 72 0A foo.bar.