COLUMN(1)
๐ฆ column(1) ๐ User Commands โจ
okay bestie, this is the column page from the User Commands section and it's genuinely one of my faves โ it's giving "turn a chaotic list into a gorgeous lil table" energy and I'm obsessed. let's get into it ๐ซถ
๐ธ NAME ๐ธ
column โ columnate lists โจ
๐ SYNOPSIS ๐
column [options] [file ...]
๐ DESCRIPTION ๐
okay so the column utility formats its input into multiple columns, and it's got three modes, bestie. pick your fighter:
- fill columns before rows โ this is the default mode (and it's required for backwards compatibility, so don't come for it).
- fill rows before columns โ enabled with the
-x,--fillrowsoption. - create a table โ figure out how many columns the input has and make a table. enabled with the
-t/--tableoption. output gets aligned to the terminal width in interactive mode, and to 80 columns in non-interactive mode (peep--output-widthfor the deets). you can also apply custom formatting with the various--table-*options. iconic.
Input comes from file, or otherwise from standard input. empty lines are ignored, and all invalid multibyte sequences get encoded with the x<hex> convention. no cap. ๐
โจ OPTIONS โจ
quick lore drop before the options, because the columns argument (used by the --table-* options below) is a whole thing:
it's a comma-separated list of either:
- user-supplied names defined with
--table-columnsname1,name2,..., or - indices of columns as they appear in the input, beginning with 1, or
- names defined through a
--table-columnattribute.
you can absolutely mix names and indices, it's fine, live your truth. the special placeholder '0' (e.g. -R0) may be used to specify all columns, and '-1' (e.g. -R -1) to specify the last visible column. and yes bestie, ranges like '1-5' work when you're addressing columns by indices. slay. ๐
-J,--jsonโ use JSON output format to print the table. the option--table-columnsis required and the option--table-nameis recommended.-c,--output-widthwidth โ output is formatted to a width specified as a number of characters. note that input longer than width is not truncated by default. the default is the terminal width in interactive mode, and 80 columns in non-interactive mode. the column headers are never truncated.
the placeholder unlimited (or 0) can be used to prevent restricting the output width. this is recommended when redirecting output to a file. ๐
(the original long name of this option was --columns; this name is deprecated since v2.30.)
-d,--table-noheadingsโ omit printing the header. this option allows having user-supplied column names on the command line, but keeps the header hidden when printing the table. sneaky. ๐-o,--output-separatorstring โ column delimiter for table output (default is two spaces).-s,--input-separator,--separatorseparators โ possible input-item delimiters (default is whitespace).-S,--use-spacesnumber โ when not in table mode, use spaces instead of tabulators to align the columns. this option specifies the minimum number of spaces that separate two columns.-t,--tableโ determine the number of columns the input contains and create a table. columns are by default delimited with whitespace, or with characters supplied using the--output-separatoroption. table output is useful for pretty-printing. ๐--table-colorschemename โ specifies color scheme. the default name is"column". for more details see the COLORS section.-C,--table-columnattributes โ define a column with a comma-separated list of attributes. this option can be used more than once โ every use defines a single column. attributes replace some of the--table-*options: for example,--table-column name=FOO,rightdefines a column where text is aligned to the right. this option is mutually exclusive with-N/--table-columns. ๐ค
supported attributes are:
name=string โ column name.truncโ truncate column text when necessary. the same as--table-truncate. note that the column header is never truncated, and it is the minimal column width.treeโ use this column for tree-like output. see--treefor more details. ๐ณrightโ right align text. the same as--table-right.width=number โ column width. it's used only as a hint. to enforce it, specify thestrictwidthattribute as well. the actual minimum width is the column header width.strictwidthโ strictly follow thewidth=to set the minimum size of the column. the column can be larger if the output width provides enough space.noextremesโ ignore unusually long content width. see--table-noextremefor more details.hiddenโ don't print the column. see--table-hidefor more details.wrapโ allow the use of a multi-line cell for long text if necessary. note that the column header is never wrapped and determines the minimum column width. see--table-wrapfor more details.wrapnlโ wrap at newline characters; newlines in cell data are treated as line breaks.wrapzeroโ wrap at zero (NUL) characters in cell data.json=type โ define the column type for JSON output. supported types arestring,number,float,array-string,array-numberandboolean.color=name โ define the column color for output on the terminal. the name is a color name (black,blink,blue,bold,brown,cyan,darkgray,gray,green,halfbright,lightblue,lightcyan,lightgray,lightgreen,lightmagenta,lightred,magenta,red,reset,reverse, andyellow) or ANSI color sequence number(s) separated by a semicolon, but without the'ESC['prefix and'm'suffix. for example,"37;41"defines sequences for a red background and white foreground. for more details see the COLORS section. ๐colorkey=name โ addresses color as defined in the color scheme. see--table-colorscheme.headercolor=name โ likecolor=, but define the color for column header only.headercolorkey=name โ addresses color for header as defined in the color scheme. see--table-colorscheme.
-N,--table-columnsnames โ specify column names with a comma-separated list. the names are used for the table header and for column addressing in option arguments. see also--table-column.-l,--table-columns-limitnumber โ specify the maximum number of input columns. the last column will contain all remaining line data if the limit is smaller than the number of columns in the input data.-R,--table-rightcolumns โ right align text in the specified columns.-T,--table-truncatecolumns โ specify the columns where text can be truncated when necessary, otherwise very long table entries may be printed on multiple lines.-E,--table-noextremecolumns โ specify the columns where longer-than-average content should be ignored when calculating the column width. the option influences width calculation and table formatting, but the printed text is not affected.
this option is active by default for the last visible column.
-e,--table-header-repeatโ print header line for each page.-K,--table-header-as-columnsโ use the first input line as table header. this option is mutually exclusive with--table-columnsand--table-column.-W,--table-wrapcolumns โ specify the columns where multi-line cells can be used for long text. by default, text is wrapped according to column width. use--wrap-separatorto wrap at custom separator characters instead. note that the column header is never wrapped and determines the minimum column width.--wrap-separatorstring โ use string as a separator for wrapping text within columns that have wrapping enabled. the separator is replaced with newlines when the text is displayed. this option requires table mode and columns with wrapping enabled (see--table-wrap). for example, use|to allow wrapping at pipe characters within column data.-H,--table-hidecolumns โ don't print the specified columns. the special placeholder'-'may be used to hide all unnamed columns (see--table-columns). ๐คซ-O,--table-ordercolumns โ specify the output column order.-n,--table-namename โ specify the table name used for JSON output. the default is"table".-m,--table-maxoutโ fill all available space on output.-L,--keep-empty-linesโ preserve whitespace-only lines in the input. the default is to ignore all empty lines. this option's original name was--table-empty-lines, but has since been deprecated because it gives the false impression that the option only applies to table mode.-r,--treecolumn โ specify the column to use for a tree-like output. note that the circular dependencies and other anomalies in child and parent relation are silently ignored.-i,--tree-idcolumn โ specify the column that contains each line's unique child ID for a child-parent relation.-p,--tree-parentcolumn โ specify the column that contains each line's parent ID for a child-parent relation.-x,--fillrowsโ fill rows before filling columns.--color[=when]โ colorize the output. the optional argument when can beauto,neveroralways. if the when argument is omitted, it defaults toauto. the colors can be disabled; for the current built-in default see the--helpoutput. see also the COLORS section.-h,--helpโ display help text and exit.-V,--versionโ display version and exit.
okay and that's where part 1 wraps, bestie โ more is coming so don't go anywhere ๐๐ฆ
๐ COLORS ๐
okay bestie, so the whole colorization thing? it's implemented by terminal-colors.d(5) functionality. Implicit coloring can be turned off by an empty file:
/etc/terminal-colors.d/column.disable
... for the column command only. Or for all tools, use:
/etc/terminal-colors.d/disable
Since version 2.41, the $NO_COLOR environment variable is also supported to disable output colorization unless explicitly enabled by a command-line option.
The user-specific $XDG_CONFIG_HOME/terminal-colors.d or $HOME/.config/terminal-colors.d overrides the global setting.
Note that the output colorization may be enabled by default, and in this case terminal-colors.d directories do not have to exist yet.
The default color scheme name is "column," and it can be overridden by
--table-colorscheme name
Then name[.disable|enable|scheme] file may be used in /etc/terminal-colors.d/, $XDG_CONFIG_HOME/terminal-colors.d, or $HOME/.config/terminal-colors.d/.
The logical color name (key) in the color scheme may be addressed by column properties colorkey= and headercolorkey=. For example
echo 'important red' > ~/.config/terminal-colors.d/cooltable.scheme
echo 'important-header 37;41' >> ~/.config/terminal-colors.d/cooltable.scheme
echo -e "a b c\naa bb cc\naaa bbb ccc" | column -t \
--table-colorscheme=cooltable \
-C name=AAA,colorkey=important,headercolorkey=important-header \
-C name=BBB,color=magenta,headercolor=cyan \
-C name=CCC,color=green
This will create a color scheme with the name "cooltable" and colorize the first column header and data according to keys from the scheme. The other two columns will be colorized by direct color names.
๐ฑ ENVIRONMENT ๐ฑ
COLUMNSโ is used to determine the size of the screen if no other information is available.LIBSMARTCOLS_DEBUG=allโ enables libsmartcols debug output.LIBSMARTCOLS_DEBUG_PADDING=onโ use visible padding characters.
๐ HISTORY ๐
The column command appeared in 4.3BSD-Reno.
๐ BUGS ๐
Version 2.23 changed the -s option to be non-greedy, for example:
printf "a:b:c\n1::3\n" | column -t -s ':'
Old output:
a b c
1 3
New output (since util-linux 2.23):
a b c
1 3
Historical versions of this tool indicated that "rows are filled before columns" by default, and that the -x option reverses this. This wording did not reflect the actual behavior, and it has since been corrected (see above). Other implementations of column may continue to use the older documentation, but the behavior should be identical in any case.
โจ EXAMPLES โจ
Print fstab with a header line and align numbers to the right:
sed 's/#.*//' /etc/fstab | column --table --table-columns SOURCE,TARGET,TYPE,OPTIONS,FREQ,PASS --table-right FREQ,PASS
Print fstab and hide unnamed columns:
sed 's/#.*//' /etc/fstab | column --table --table-columns SOURCE,TARGET,TYPE --table-hide -
Print a tree:
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
1 0 A
2 1 |-AA
4 2 | |-AAA
5 2 | `-AAB
3 1 `-AB
Print table with custom wrap separator:
echo -e 'Name:Description\nJohn:A|software|developer\nJane:A|data|scientist' | column --table --separator ':' --table-wrap 2 --wrap-separator '|'
Name Description
John A
software
developer
Jane A
data
scientist
๐ SEE ALSO ๐
colrm(1), ls(1), paste(1), sort(1)
๐ REPORTING BUGS ๐
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
๐ฆ AVAILABILITY ๐ฆ
The column command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
this page is from util-linux 2.42.4, dated 2026-09-21, and it's for COLUMN(1) โ stay slaying, bestie ๐ โจ
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms