Format the output of a command for a 30 characters wide display

column

  • Format standard input or a file into multiple columns.
    Columns are filled before rows; the default separator is a whitespace.
    More information: <https://manned.org/column>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

printf "header1 header2\nbar foo\n" | column --output-width {{30}}

click the source code to copy install column on any operating system with command-not-found.com