column — turn any column-shaped mess into a real table

You ran ls -l or cut -d: and got alphabet soup. column -t is the unix pipe cleaner: paste it at the end of any pipeline and the output snaps into aligned columns.

column reads text and reprints it as aligned columns — that’s the whole tool, and that’s why it’s everywhere: it’s been in BSD since 4.3BSD-Reno and ships on macOS and every Linux. The flag that does 99% of the work is -t: it figures out how many columns your input has (whitespace-delimited by default, or split on -s characters) and pads each field to the width of its column’s widest entry. Because it reads stdin and writes stdout, it slides into any pipeline — the canonical use is fixing the ragged output of other commands, like piping ls -l through it, or tabulating a cut of /etc/passwd. A second mode exists for the opposite problem: a long list you want flowed into a space-efficient grid, which is what plain column (no -t) does to directory listings.

install

macOS
Debian/Ubuntu
sudo apt install util-linux
Fedora
sudo dnf install util-linux
Arch
sudo pacman -S util-linux

examples

# The classic: make ls -l readable again
ls -l | column -t
# Delimited data: split on colons, then align (BSD needs -s
# to be a literal set — it is not a regex)
cut -d: -f1,3,7 /etc/passwd | column -t -s:
# Fields with different separators in one line: give the set
printf "name, age\nada, 36\n" | column -t -s,
# Tabulate a file, not stdin
column -t -s: /etc/group
# Grid mode (no -t): one file's lines flowed across columns
ls | column
# Cap the grid at a display width (COLUMNS env or -c)
ls | column -c 60

pro tip

column -t doesn’t care where its input came from, so it also cleans up your own scripts: printf a tab-separated report from a loop, pipe through column -t, and it renders like a spreadsheet. And blank input lines are silently ignored, so gaps in messy data don’t become gaps in your table.

honest limits

This is the BSD column (checked on macOS 26.6), and the variants differ: GNU column from util-linux adds -o to choose the output delimiter — macOS’s does not (illegal option), so you cannot pick your padding character here. Input lines are capped at 2048 bytes (LINE_MAX) and empty lines are dropped. With -s, adjacent delimiters collapse into one separator, so truly empty fields vanish — don’t tabulate CSVs with blank cells through it. And -x (fill columns before rows) needs -c to do anything interesting: on a single-line input it changes nothing. For anything stricter than eyeball formatting, write real CSV and use a real tool.