unexpand - convert spaces to tabs
unexpand [-a]
-a All spaces are unexpanded
unexpand oldfile >newfile # Convert leading spaces to tabs
Unexpand replaces spaces in the named files with tabs. If no files are listed, stdin is given. The -a flag is used to force all sequences of spaces to be expanded, instead of just leading spaces (the default).
expand(1).