Unexpand Explained

unexpand
Operating System:Unix and Unix-like
Platform:Cross-platform
Genre:Command

unexpand is a command in Unix and Unix-like operating systems. It is used to convert groups of space characters into tab characters.[1]

For example:

$ echo " asdf sdf" | unexpand | od -c0000000 \t \t a s d f s d f \n0000014$ echo " asdf sdf" | od -c00000000000020 a s d f s d f \n0000032

Here the echo command prints a string of text that includes multiple consecutive spaces, then the output is directed into the unexpand command. The resulting output is then displayed by the octal dump command od. At the second prompt, the same echo output is sent directly through the od command. As can be seen by comparing the two, the unexpand program converts sequences of eight spaces into single tabs (printed as '\t').

See also

External links

Notes and References

  1. Web site: unexpand - Compress spaces into tabs . 2024-05-09 . www.ibm.com . en-us.