EG:
$ head /etc/passwd | expand-nicely --separation-regex ':' below cmd output started 2026 Thu Jan 01 09:52:02 AM PST root x 0 0 root /root /bin/bash daemon x 1 1 daemon /usr/sbin /usr/sbin/nologin bin x 2 2 bin /bin /usr/sbin/nologin sys x 3 3 sys /dev /usr/sbin/nologin sync x 4 65534 sync /bin /bin/sync games x 5 60 games /usr/games /usr/sbin/nologin man x 6 12 man /var/cache/man /usr/sbin/nologin lp x 7 7 lp /var/spool/lpd /usr/sbin/nologin mail x 8 8 mail /var/mail /usr/sbin/nologin news x 9 9 news /var/spool/news /usr/sbin/nologin above cmd output done 2026 Thu Jan 01 09:52:02 AM PSTThe usage message looks like:
$ expand-nicely --help
below cmd output started 2026 Thu Jan 01 09:51:43 AM PST
Usage: /usr/local/bin/expand-nicely --separation-regex ' *|\t' --maxsplit 3 --output-separator ' ' --help
--separation-regex re the regular expression used to divide lines of input into fields
--maxsplit n split each line into a maximum of n+1 columns, where the n+1th may contain
zero or more occurences of your separation regex. 0 says to split on all
occurences
--output-separator string the string used to separate fields in adjacent output columns
above cmd output done 2026 Thu Jan 01 09:51:43 AM PST
You can e-mail the author with questions or comments: