Home·Terminal commands

column

Text processing

Usage

column -t [file]

Pads fields so the columns line up like a table; repeated separators count as one, so a CSV with empty cells comes out shifted.

Common flags

FlagMeaning
-tWork out the columns and line them up as a table
-sWhich characters separate the input columns, with -t
-xFill columns before rows
-cFormat for a display this many characters wide
-outil-linux: what to put between the output columns

Examples

mount | column -t

Lines the mount table up.

column -t -s, data.csv

Reads a CSV into aligned columns.

ls | column -x

Prints the listing in columns across the screen.

These were built to be piped together. Three joined commands are usually shorter than one that does everything.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does column do?

Pads fields so the columns line up like a table; repeated separators count as one, so a CSV with empty cells comes out shifted.

Q. How do I type it?

column -t [file] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

5 are listed here; the full set is in man column. This command sits under Text processing.

Related commands

man page: man column