column

Linux · Text · reference only

What it does

Formats its input into columns. With -t it aligns the fields like a table, which makes long output easier to read.

Syntax

column [opciones] [fichero...]

Options and parameters

  • -t

    Builds a table by aligning the columns according to the fields of each line.

  • -s separador

    Characters that separate the fields in the input, to use with -t.

  • -o cadena

    String that separates the columns in the table output.

  • -c ancho

    Spreads the input into columns fitted to that screen width.

  • -x

    Fills by rows first instead of by columns.

  • -J

    Prints the table as JSON (needs -N to name the columns).

Usage examples

  • column -t -s: /etc/passwd | head -3

    Shows the first three accounts with the fields aligned.

  • mount | column -t

    Aligns the output of mount to read it better.

  • printf 'a,b\nc,d\n' | column -t -s,

    Turns comma-separated data into an aligned table.

  • ls | column -c 80

    Spreads the names into columns for an 80-character screen.

Notes and common mistakes

  • On Debian and Ubuntu it ships in the bsdextrautils package, which may not be installed on minimal systems.

Related commands