Skip to main content

column

The column command is a utility that formats its input into multiple columns. It's particularly useful for creating well-aligned, readable tables out of text files that use delimited structures, like CSV files or /etc/passwd.

Basic Syntax

column [options] [file...]

Common Options

OptionDescription
-t, --tableDetermine the number of columns the input contains and create a table.
-s, --separator=SEPSpecify the possible input item delimiters (default is whitespace).
-o, --output-separator=SEPSpecify the columns delimiter for table output (default is two spaces).

Real-world Examples

  1. Format a comma-separated file into a neat table:

    cat data.csv | column -s ',' -t
  2. Format /etc/passwd to make it readable:

    column -s ':' -t /etc/passwd
  3. Format mount output into a table:

    mount | column -t