Skip to content

Instantly share code, notes, and snippets.

@rhogeranacleto
Last active January 30, 2018 19:01
Show Gist options
  • Save rhogeranacleto/1bffce7b452c9a316835512a765453e0 to your computer and use it in GitHub Desktop.
Save rhogeranacleto/1bffce7b452c9a316835512a765453e0 to your computer and use it in GitHub Desktop.
Display a table with columns in shell
(
printf 'PID\tUSER\tAPPNAME\n'
printf '%s\t%s\t%s\n' "1" "john" "foo bar"
printf '%s\t%s\t%s\n' "12345678" "someone_with_a_long_name" "pop tart"
) | column -t -s $'\t'
# ref Patrick on https://unix.stackexchange.com/a/162916
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment