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
| Flag | Meaning |
|---|---|
| -t | Work out the columns and line them up as a table |
| -s | Which characters separate the input columns, with -t |
| -x | Fill columns before rows |
| -c | Format for a display this many characters wide |
| -o | util-linux: what to put between the output columns |
Examples
mount | column -tLines the mount table up.
column -t -s, data.csvReads a CSV into aligned columns.
ls | column -xPrints 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