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
-tBuilds a table by aligning the columns according to the fields of each line.
-s separadorCharacters that separate the fields in the input, to use with -t.
-o cadenaString that separates the columns in the table output.
-c anchoSpreads the input into columns fitted to that screen width.
-xFills by rows first instead of by columns.
-JPrints the table as JSON (needs -N to name the columns).
Usage examples
column -t -s: /etc/passwd | head -3Shows the first three accounts with the fields aligned.
mount | column -tAligns 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 80Spreads 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.