Usage:
column [options] [<file>...]
Columnate lists.
Options:
-t, --table create a table
-n, --table-name <name> table name for JSON output
-O, --table-order <columns> specify order of output columns
--table-colorscheme <name> specify color scheme name
-C, --table-column <properties> define column
-N, --table-columns <names> comma separated columns names
-l, --table-columns-limit <num> maximal number of input columns
-E, --table-noextreme <columns> don't count long text in these columns
to the column's width
-d, --table-noheadings don't print header
-m, --table-maxout fill all available space
-e, --table-header-repeat repeat header for each page
-K, --table-header-as-columns use the first row as table header
-H, --table-hide <columns> don't print the columns
-R, --table-right <columns> right align text in these columns
-T, --table-truncate <columns> truncate text in the columns when necessary
-W, --table-wrap <columns> wrap text in the columns when necessary
--wrap-separator <string> wrap at this separator (requires --table-wrap)
-L, --keep-empty-lines don't ignore empty lines
-J, --json use JSON output format for table
-r, --tree <column> column to use tree-like output for the table
-i, --tree-id <column> line ID to specify child-parent relation
-p, --tree-parent <column> parent to specify child-parent relation
-c, --output-width <width> width of output in number of characters
-o, --output-separator <string> columns separator for table output
(default is two spaces)
-s, --input-separator, --separator <string>
possible table delimiters
-x, --fillrows fill rows before columns
-S, --use-spaces <number> minimal whitespaces between columns (no tabs)
--color[=<when>] colorize output (auto, always or never)
colors are enabled by default
-h, --help display this help
-V, --version display version
For more details see column(1).
Options (30)
| Option | Description | Source |
|---|
-t, --table | Determine the number of columns the input contains and create a table. | help + man |
-n, --table-name name | Specify the table name used for JSON output. | help + man |
-O, --table-order columns | Specify the output column order. | help + man |
--table-colorscheme name | specify color scheme name | help + man |
-C, --table-column properties | Define a column with a comma-separated list of attributes. | help + man |
-N, --table-columns names | Specify column names with a comma-separated list. | help + man |
-l, --table-columns-limit num | Specify the maximum number of input columns. | help + man |
-E, --table-noextreme columns | Specify the columns where longer-than-average content should be ignored when calculating the column width. | help + man |
-d, --table-noheadings | Omit printing the header. | help + man |
-m, --table-maxout | Fill all available space on output. | help + man |
-e, --table-header-repeat | Print header line for each page. | help + man |
-K, --table-header-as-columns | Use the first input line as table header. | help + man |
-H, --table-hide columns | Don’t print the specified columns. | help + man |
-R, --table-right columns | Right align text in the specified columns. | help + man |
-T, --table-truncate columns | Specify the columns where text can be truncated when necessary, otherwise very long table entries may be printed on multiple lines. | help + man |
-W, --table-wrap columns | Specify the columns where multi-line cells can be used for long text. | help + man |
--wrap-separator string | Use string as a separator for wrapping text within columns that have wrapping enabled. | help + man |
-L, --keep-empty-lines | Preserve whitespace-only lines in the input. | help + man |
-J, --json | Use JSON output format to print the table. | help + man |
-r, --tree column | Specify the column to use for a tree-like output. | help + man |
-i, --tree-id column | Specify the column that contains each line’s unique child ID for a child-parent relation. | help + man |
-p, --tree-parent column | Specify the column that contains each line’s parent ID for a child-parent relation. | help + man |
-c, --output-width width | Output is formatted to a width specified as a number of characters. | help + man |
-o, --output-separator string | columns separator for table output (default is two spaces) | help + man |
-s, --input-separator, --separator string | Possible input-item delimiters (default is whitespace). | help + man |
-x, --fillrows | Fill rows before filling columns. | help + man |
-S, --use-spaces number | When not in table mode, use spaces instead of tabulators to align the columns. | help + man |
--color when | colorize output (auto, always or never) colors are enabled by default | help + man |
-h, --help | Display help text and exit. | help + man |
-V, --version | Display version and exit. | help + man |
Examples (4) from the manual page, untested
sed 's/#.*//' /etc/fstab | column --table --table-columns SOURCE,TARGET,TYPE,OPTIONS,FREQ,PASS --table-right FREQ,PASS
Print fstab with a header line and align numbers to the right:sed 's/#.*//' /etc/fstab | column --table --table-columns SOURCE,TARGET,TYPE --table-hide -
Print fstab and hide unnamed columns:echo -e '1 0 A\n2 1 AA\n3 1 AB\n4 2 AAA\n5 2 AAB' | column --tree-id 1 --tree-parent 2 --tree 3
Print a tree:echo -e 'Name:Description\nJohn:A|software|developer\nJane:A|data|scientist' | column --table --separator ':' --table-wrap 2 --wrap-separator '|'
Print table with custom wrap separator:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.