]> git.ipfire.org Git - thirdparty/util-linux.git/blob - text-utils/column.1
column: rename options
[thirdparty/util-linux.git] / text-utils / column.1
1 .\" Copyright (c) 1989, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)column.1 8.1 (Berkeley) 6/6/93
33 .\"
34 .TH COLUMN 1 "January 2017" "util-linux" "User Commands"
35 .SH NAME
36 column \- columnate lists
37 .SH SYNOPSIS
38 .BR column " [options]"
39 .RI [ file ...]
40 .SH DESCRIPTION
41 The
42 .B column
43 utility formats its input into multiple columns. By default, columns
44 are filled before rows. Input is taken from \fIfile\fR, or
45 otherwise from standard input. Empty lines are ignored.
46 .PP
47 .SH OPTIONS
48 .IP "\fB\-J, \-\-json\fP"
49 Use JSON output format to print the table, the option
50 \fB\-\-table\-colnames\fP is required and the option \fB\-\-table\-name\fP is recommended.
51 .IP "\fB\-c, \-\-output\-width\fP \fIwidth\fP"
52 Output is formatted to a width specified as number of characters. The original
53 name of this option is --columns; this name deprecated since v2.30.
54 .IP "\fB\-o, \-\-output\-separator\fP \fIstring\fP"
55 Specify the columns delimiter for table output (default is two spaces).
56 .IP "\fB\-s, \-\-separator\fP \fIseparators\fP"
57 Specify the possible input item delimiters (default is whitespace).
58 .IP "\fB\-t, \-\-table\fP"
59 Determine the number of columns the input contains and create a table.
60 Columns are delimited with whitespace, by default, or with the characters
61 supplied using the \fB\-\-output\-separator\fP option.
62 Table output is useful for pretty-printing.
63 .IP "\fB\-N, \-\-table-columns\fP \fInames\fP"
64 Specify the columns names by comma separated list of names. The names are used
65 for the table header or to addres column in option arguments.
66 .IP "\fB\-R, \-\-table-right\fP \fIcolumns\fP"
67 Right align text in the specified columns. The \fIcolumns\fP is comma separated
68 list of the column names (see \fB\-\-table-columns\fP) or column number.
69 .IP "\fB\-n, \-\-table-name\fP \fIname\fP"
70 Specify the table name used for JSON output. The defaout is "table".
71 .IP "\fB\-x, \-\-fillrows\fP"
72 Fill rows before filling columns.
73 .IP "\fB\-V\fR, \fB\-\-version\fR"
74 Display version information and exit.
75 .IP "\fB\-h, \-\-help\fP"
76 Display help text and exit.
77 .SH ENVIRONMENT
78 The environment variable \fBCOLUMNS\fR is used to determine the size of
79 the screen if no other information is available.
80 .SH EXAMPLES
81 .nf
82 .B sed 's/#.*//' /etc/fstab | column -t
83 .nf
84 .SH BUGS
85 Version 2.23 changed the
86 .B \-s
87 option to be non-greedy, for example:
88 .PP
89 .EX
90 \fBprintf "a:b:c\\n1::3\\n" | column -t -s ':'\fR
91 .EE
92 .PP
93 Old output:
94 .EX
95 a b c
96 1 3
97 .EE
98 .PP
99 New output (since util-linux 2.23):
100 .EX
101 a b c
102 1 3
103 .EE
104 .SH "SEE ALSO"
105 .BR colrm (1),
106 .BR ls (1),
107 .BR paste (1),
108 .BR sort (1)
109 .SH HISTORY
110 The column command appeared in 4.3BSD-Reno.
111 .SH AVAILABILITY
112 The column command is part of the util-linux package and is available from
113 https://www.kernel.org/pub/linux/utils/util-linux/.