Documented in Volume 1 of the UNIX Programmers Manual.
% unexpand filein
in file filein, for leading blanks and tabs, substitute as many tabs as
necessary to squeeze out extra white space.
% unexpand -a filein
in file filein, for ANY blanks and tabs, substitute as many tabs as
necessary to squeeze out extra white space.
% cat filein | unexpand -a
take file filein and pipe it to unexpand, then for ANY blanks and tabs,
substitute as many tabs as necessary to squeeze out extra white space.
See also expand.
See /usr/lib/term for printer tab definitions.