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 --table-\* options is a comma separated list of user supplied names, defined with --table-columnname1,name2,..., indices of columns, as theyappear in the input, beginning with 1, or names, defined by a--table-columnsattribute.It’s possible to mix names and indices. The special placeholder '0' (e.g. -R0) maybe 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-widthwidth
The placeholder "unlimited" (or 0) can be used to prevent restricting output width. This is recommended for example when redirecting output to a file.
-d, --table-noheadings
-o, --output-separatorstring
-s, --separatorseparators
-S, --use-spacesnumber
-t, --table
-C, --table-columnattributes
Supported attributes are:
name=string
trunc
right
width=number
strictwidth
noextreme
wrap
hide
json=type
-N, --table-columnsnames
-l, --table-columns-limitnumber
-R, --table-rightcolumns
-T, --table-truncatecolumns
-E, --table-noextremecolumns
The option is used for the last visible column by default.
-e, --table-header-repeat
-W, --table-wrapcolumns
-H, --table-hidecolumns
-O, --table-ordercolumns
-n, --table-namename
-m, --table-maxout
-L, --keep-empty-lines
-r, --treecolumn
-i, --tree-idcolumn
-p, --tree-parentcolumn
-x, --fillrows
-h, --help
-V, --version
ENVIRONMENT
The environment variable COLUMNS is used to determine the size of the screen if no other information is available.
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 3New output (since util-linux 2.23):
a b c
1 3Historical 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,PASSPrint 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 `-ABSEE 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/>.