Unexpand
Encyclopedia
unexpand is a command in the UNIX Operating System
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

. It is used to convert groups of space character
Character (computing)
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written form of a natural language....

s into tab
Tab
Tab or tabs may refer to:* Tab, a British Army term for a loaded march* Tab , by Monster Magnet* Tab , a small protective covering for the fingers* Tab , the mechanism for opening a beverage can...

s.

For example:

$ echo " asdf sdf" | unexpand | od -c
0000000 \t \t a s d f s d f \n
0000014
$ echo " asdf sdf" | od -c
0000000
0000020 a s d f s d f \n
0000032

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
Octal
The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Numerals can be made from binary numerals by grouping consecutive binary digits into groups of three...

 dump command od
OD
- Non abbreviated meanings of OD :* Od , a language of the Oad people* Od, a life force - see Odic force* Od, a Nordic god - see Óðr* Od, a replacement for "God" in some minced oaths- Health and medicine :...

. 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').
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK