Quick take: The column command formats text into aligned columns. column -t turns whitespace- or delimiter-separated data into a neat table; add -s to set the delimiter, making CSV and command output easy to read.
Introduction
The column command takes ragged, hard-to-read text and aligns it into tidy columns. It is the finishing touch for command output, CSV files, and any data where alignment turns a wall of text into a readable table.
Syntax
The basic syntax of the column command is:
column [OPTIONS] [FILE]Common Options and Parameters
The most useful options and parameters for the column command:
| Option | Description |
|---|---|
| -t | Create a table, aligning columns by their content. |
| -s SEP | Set the input delimiter (use with -t). |
| -o SEP | Set the output column separator. |
| -N NAMES | Provide column headers (newer versions). |
| -x | Fill columns before rows. |
| -c WIDTH | Format into the given total width. |
Practical Examples
Real column commands you can run today:
# Align mount output into a table
mount | column -t
# Format a CSV as a readable table
column -t -s ',' data.csv
# Align /etc/passwd by its colons
column -t -s ':' /etc/passwd
# Make df output neat
df -h | column -t
# Pretty-print a TSV file
column -t -s $'\t' data.tsvTips and Best Practices
column -tis the quick fix for any misaligned command output — pipe almost anything through it.- Pair
-twith-sto align delimited data:column -t -s ','for CSV. - For a TSV, use
-s $'\t'so the tab character is passed correctly as the delimiter.
Final Thoughts
column is the simplest way to make tabular output readable — aligning whitespace or delimited data into clean columns with -t and -s. Pipe CSV, /etc/passwd, or any command's output through it for instant tables. It pairs naturally with cut, sort, and awk at the end of a pipeline.
FAQ: column Command in Linux
How do I align text into columns in Linux?+
Pipe it through column -t, which aligns whitespace-separated fields into a neat table. For example, mount | column -t makes mount output readable.
How do I format a CSV as a table?+
Use the delimiter option: column -t -s ',' data.csv aligns the comma-separated fields into columns. For TSV use -s $'\t'.
How do I make command output readable?+
Append | column -t to almost any command, such as df -h | column -t, to align the fields and remove ragged spacing.
How do I set the delimiter for column?+
Use -s with the separator character together with -t, for example column -t -s ':' to align colon-separated data like /etc/passwd.
Why does column -t not split my CSV correctly?+
Without -s, column splits on whitespace, so commas stay attached. Add -s ',' so it treats the comma as the field separator.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support