table of contents
- trixie 2.41-5
- testing 2.41.3-4
- unstable 2.41.3-4
- experimental 2.42~rc1-1
| COLUMN(1) | User Commands | COLUMN(1) |
NAME¶
column - columnate lists
SYNOPSIS¶
column [options] [file ...]
DESCRIPTION¶
The column utility formats its input into multiple columns. It supports three modes:
fill columns before rows
fill rows before columns
create a table
Input is taken from file, or otherwise from standard input. Empty lines are ignored and all invalid multibyte sequences are encoded with the x<hex> convention.
OPTIONS¶
The argument columns, for the --table-* options below, is a comma-separated list of user-supplied names defined with --table-columns name1,name2,..., or indices of columns as they appear in the input, beginning with 1, or names defined through a --table-column attribute. It’s possible to mix names and indices. 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. It’s possible to use ranges like '1-5' when addressing columns by indices.
-J, --json
-c, --output-width width
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
-o, --output-separator string
-s, --input-separator, --separator separators
-S, --use-spaces number
-t, --table
--table-colorscheme name
-C, --table-column attributes
Supported attributes are:
name=string
trunc
tree
right
width=number
strictwidth
noextremes
hidden
wrap
wrapnl
wrapzero
json=type
color=name
colorkey=name
headercolor=name
headercolorkey=name
-N, --table-columns names
-l, --table-columns-limit number
-R, --table-right columns
-T, --table-truncate columns
-E, --table-noextreme columns
This option is active by default for the last visible column.
-e, --table-header-repeat
-K, --table-header-as-columns
-W, --table-wrap columns
--wrap-separator string
-H, --table-hide columns
-O, --table-order columns
-n, --table-name name
-m, --table-maxout
-L, --keep-empty-lines
-r, --tree column
-i, --tree-id column
-p, --tree-parent column
-x, --fillrows
--color[=when]
-h, --help
-V, --version
COLORS¶
The output colorization is implemented by terminal-colors.d(5) functionality. Implicit coloring can be disabled by an empty file
/etc/terminal-colors.d/column.disable
for the column command or for all tools by
/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
LIBSMARTCOLS_DEBUG=all
LIBSMARTCOLS_DEBUG_PADDING=on
LIBSMARTCOLS_JSON=compact|lines
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¶
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/>.
| 2026-02-25 | util-linux 2.42-rc1 |