Unexpand
   HOME

TheInfoList



OR:

unexpand is a command in
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s. It is used to convert groups of space characters into
tab character Tab, TAB, tabs, or TABS may refer to: Places * Tab, Hungary, a town * Tab District, Hungary, whose seat is Tab * Tab, Indiana, United States, an unincorporated community * Arthur Napoleon Raymond Robinson International Airport, Tobago, IATA c ...
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 (base 8) is a numeral system with eight as the base. In the decimal system, each place is a power of ten. For example: : \mathbf_ = \mathbf \times 10^1 + \mathbf \times 10^0 In the octal system, each place is a power of eight. For ex ...
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

*
List of Unix commands This is a list of the shell commands of the most recent version of the Portable Operating System Interface (POSIX) IEEE Std 1003.1-2024 which is part of the Single UNIX Specification (SUS). These commands are implemented in many shells on moder ...
* Expand (Unix)


References


External links



The program's
manpage A man page (short for manual page) is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administ ...
{{Core Utilities commands Unix SUS2008 utilities