unexpand

Convert spaces to tabs. More information: https://www.gnu.org/software/coreutils/unexpand.

unexpand path/to/file

unexpand

unexpand -a path/to/file

unexpand --first-only path/to/file

unexpand -t number path/to/file