column -t: Align Output Into Columns
column -t formats input into a table, padding fields so columns line up.
column -t turns ragged whitespace-separated rows into an aligned table, ideal for readable summaries in CI logs.
What it does
column -t creates a table by determining the number of columns and padding each field so they align. By default it splits on whitespace; -s sets a different input separator and -o sets the output separator. It is the quickest way to pretty-print rows of data.
Common usage
cat data.txt | column -t # align on whitespace
column -t -s, data.csv # treat comma as separator
mount | column -t # readable mount table
printf 'name age\nalice 30\nbob 7\n' | column -tOptions
| Flag | What it does |
|---|---|
| -t | Create a table (align columns) |
| -s <chars> | Input field separator(s) |
| -o <str> | Output column separator (util-linux) |
| -N <names> | Name columns (newer util-linux) |
| -R <cols> | Right-align the listed columns (newer util-linux) |
In CI
Pipe a summary table through column -t to make CI log output readable at a glance. Be aware column collapses runs of whitespace by default, so an empty field in the middle of a row can shift later columns unless you use -s with the right separator.
Common errors in CI
column comes from util-linux on Linux but BSD/macOS ships a different implementation; flags like -o, -N, and -R are util-linux-only and fail on macOS runners. By default empty fields are dropped, so rows with missing values misalign; pass -s and, on newer util-linux, --table-empty-lines or explicit separators. Very long lines may be truncated to terminal width when no TTY width is known.