$linuxjunkies
>

column(1)

Format input into multiple columns with aligned text.

UbuntuDebianFedoraArch

Synopsis

column [OPTION]... [FILE]...

Description

The column command reads input from files or stdin and formats it into multiple aligned columns. It automatically detects the optimal column width and number of columns based on terminal width, making output more readable and compact.

This is particularly useful for displaying lists, tabular data, and command output in a visually organized way. By default, it fills columns from left to right.

Common options

FlagWhat it does
-tTreat input as tab-separated values; align columns by the delimiter
-s DELIMUse DELIM as the column separator character instead of whitespace
-c WIDTHSet the maximum output width to WIDTH characters
-xFill columns horizontally (left-to-right) instead of vertically
-nSort columns in ascending order
-o OUTPUTUse OUTPUT as the string to separate columns in output
-TDetermine column types and align appropriately (numbers right, text left)
-eTreat consecutive spaces as a single separator
-R COLSRight-align columns specified by comma-separated list COLS
-J COLSLeft-align columns specified by comma-separated list COLS

Examples

Format a list of filenames into multiple aligned columns

ls -1 | column

Display passwd file as aligned columns using colon as separator

column -t -s: /etc/passwd

Format fruit names into columns with maximum width of 20 characters

echo -e 'apple\nbanana\ncherry\ndate' | column -c 20

Format mount output into tab-aligned columns for better readability

mount | column -t

Display process list with aligned columns separated by tabs

ps aux | column -t

Fill columns from left to right (horizontal fill) instead of top-to-bottom

column -x file.txt

Format netstat output into columns using LISTEN as a separator

netstat -l | column -t -s LISTEN

Display CSV file as aligned columns using comma as field separator

cat data.csv | column -t -s,

Related commands