OSDN Git Service

util-linux 2.37.3: Reserve to translate.
[linuxjm/jm.git] / manual / util-linux / original / man1 / column.1
1 '\" t
2 .\"     Title: column
3 .\"    Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
5 .\"      Date: 2022-01-24
6 .\"    Manual: User Commands
7 .\"    Source: util-linux 2.37.3
8 .\"  Language: English
9 .\"
10 .TH "COLUMN" "1" "2022-01-24" "util\-linux 2.37.3" "User Commands"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 column \- columnate lists
32 .SH "SYNOPSIS"
33 .sp
34 \fBcolumn\fP [options] [\fIfile\fP ...]
35 .SH "DESCRIPTION"
36 .sp
37 The \fBcolumn\fP utility formats its input into multiple columns. The util support three modes:
38 .sp
39 \fBcolumns are filled before rows\fP
40 .RS 4
41 This is the default mode (required by backward compatibility).
42 .RE
43 .sp
44 \fBrows are filled before columns\fP
45 .RS 4
46 This mode is enabled by option \fB\-x, \-\-fillrows\fP
47 .RE
48 .sp
49 \fBtable\fP
50 .RS 4
51 Determine the number of columns the input contains and create a table. This mode is enabled by option \fB\-t, \-\-table\fP and columns formatting is possible to modify by \fB\-\-table\-\fP* options. Use this mode if not sure.
52 .RE
53 .sp
54 Input is taken from \fIfile\fP, or otherwise from standard input. Empty lines are ignored and all invalid multibyte sequences are encoded by x<hex> convention.
55 .SH "OPTIONS"
56 .sp
57 The argument \fIcolumns\fP for \fB\-\-table\-\fP* options is a comma separated list of the column names as defined by \fB\-\-table\-columns\fP or it\(cqs column number in order as specified by input. It\(cqs possible to mix names and numbers. The special placeholder \(aq0\(aq (e.g. \-R0) may be used to specify all columns.
58 .sp
59 \fB\-J, \-\-json\fP
60 .RS 4
61 Use JSON output format to print the table, the option \fB\-\-table\-columns\fP is required and the option \fB\-\-table\-name\fP is recommended.
62 .RE
63 .sp
64 \fB\-c, \-\-output\-width\fP \fIwidth\fP
65 .RS 4
66 Output is formatted to a width specified as number of characters. The original name of this option is \fB\-\-columns\fP; this name is deprecated since v2.30. Note that input longer than \fIwidth\fP is not truncated by default.
67 .RE
68 .sp
69 \fB\-d, \-\-table\-noheadings\fP
70 .RS 4
71 Do not print header. This option allows the use of logical column names on the command line, but keeps the header hidden when printing the table.
72 .RE
73 .sp
74 \fB\-o, \-\-output\-separator\fP \fIstring\fP
75 .RS 4
76 Specify the columns delimiter for table output (default is two spaces).
77 .RE
78 .sp
79 \fB\-s, \-\-separator\fP \fIseparators\fP
80 .RS 4
81 Specify the possible input item delimiters (default is whitespace).
82 .RE
83 .sp
84 \fB\-t, \-\-table\fP
85 .RS 4
86 Determine the number of columns the input contains and create a table. Columns are delimited with whitespace, by default, or with the characters supplied using the \fB\-\-output\-separator\fP option. Table output is useful for pretty\-printing.
87 .RE
88 .sp
89 \fB\-N, \-\-table\-columns\fP \fInames\fP
90 .RS 4
91 Specify the columns names by comma separated list of names. The names are used for the table header or to address column in option arguments.
92 .RE
93 .sp
94 \fB\-l, \-\-table\-columns\-limit\fP \fInumber\fP
95 .RS 4
96 Specify maximal number of the input columns. The last column will contain all remaining line data if the limit is smaller than the number of the columns in the input data.
97 .RE
98 .sp
99 \fB\-R, \-\-table\-right\fP \fIcolumns\fP
100 .RS 4
101 Right align text in the specified columns.
102 .RE
103 .sp
104 \fB\-T, \-\-table\-truncate\fP \fIcolumns\fP
105 .RS 4
106 Specify columns where text can be truncated when necessary, otherwise very long table entries may be printed on multiple lines.
107 .RE
108 .sp
109 \fB\-E, \-\-table\-noextreme\fP \fIcolumns\fP
110 .RS 4
111 Specify columns where is possible to ignore unusually long (longer than average) cells when calculate column width. The option has impact to the width calculation and table formatting, but the printed text is not affected.
112 .sp
113 The option is used for the last visible column by default.
114 .RE
115 .sp
116 \fB\-e, \-\-table\-header\-repeat\fP
117 .RS 4
118 Print header line for each page.
119 .RE
120 .sp
121 \fB\-W, \-\-table\-wrap\fP \fIcolumns\fP
122 .RS 4
123 Specify columns where is possible to use multi\-line cell for long text when necessary.
124 .RE
125 .sp
126 \fB\-H, \-\-table\-hide\fP \fIcolumns\fP
127 .RS 4
128 Don\(cqt print specified columns. The special placeholder \(aq\-\(aq may be used to hide all unnamed columns (see \fB\-\-table\-columns\fP).
129 .RE
130 .sp
131 \fB\-O, \-\-table\-order\fP \fIcolumns\fP
132 .RS 4
133 Specify columns order on output.
134 .RE
135 .sp
136 \fB\-n, \-\-table\-name\fP \fIname\fP
137 .RS 4
138 Specify the table name used for JSON output. The default is "table".
139 .RE
140 .sp
141 \fB\-L, \-\-keep\-empty\-lines\fP
142 .RS 4
143 Preserve whitespace\-only lines in the input. The default is ignore empty lines at all. This option\(cqs original name was \fB\-\-table\-empty\-lines\fP but is now deprecated because it gives the false impression that the option only applies to table mode.
144 .RE
145 .sp
146 \fB\-r, \-\-tree\fP \fIcolumn\fP
147 .RS 4
148 Specify column to use tree\-like output. Note that the circular dependencies and other anomalies in child and parent relation are silently ignored.
149 .RE
150 .sp
151 \fB\-i, \-\-tree\-id\fP \fIcolumn\fP
152 .RS 4
153 Specify column with line ID to create child\-parent relation.
154 .RE
155 .sp
156 \fB\-p, \-\-tree\-parent\fP \fIcolumn\fP
157 .RS 4
158 Specify column with parent ID to create child\-parent relation.
159 .RE
160 .sp
161 \fB\-x, \-\-fillrows\fP
162 .RS 4
163 Fill rows before filling columns.
164 .RE
165 .sp
166 \fB\-V\fP, \fB\-\-version\fP
167 .RS 4
168 Display version information and exit.
169 .RE
170 .sp
171 \fB\-h, \-\-help\fP
172 .RS 4
173 Display help text and exit.
174 .RE
175 .SH "ENVIRONMENT"
176 .sp
177 The environment variable \fBCOLUMNS\fP is used to determine the size of the screen if no other information is available.
178 .SH "HISTORY"
179 .sp
180 The column command appeared in 4.3BSD\-Reno.
181 .SH "BUGS"
182 .sp
183 Version 2.23 changed the \fB\-s\fP option to be non\-greedy, for example:
184 .sp
185 .if n .RS 4
186 .nf
187 .fam C
188 printf "a:b:c\(rsn1::3\(rsn" | column \-t \-s \(aq:\(aq
189 .fam
190 .fi
191 .if n .RE
192 .sp
193 Old output:
194 .sp
195 .if n .RS 4
196 .nf
197 .fam C
198 a  b  c
199 1  3
200 .fam
201 .fi
202 .if n .RE
203 .sp
204 New output (since util\-linux 2.23):
205 .sp
206 .if n .RS 4
207 .nf
208 .fam C
209 a  b  c
210 1     3
211 .fam
212 .fi
213 .if n .RE
214 .sp
215 Historical versions of this tool indicated that "rows are filled before columns" by default, and that the \fB\-x\fP option reverses this. This wording did not reflect the actual behavior, and it has since been corrected (see above). Other implementations of \fBcolumn\fP may continue to use the older documentation, but the behavior should be identical in any case.
216 .SH "EXAMPLES"
217 .sp
218 Print fstab with header line and align number to the right:
219 .sp
220 .if n .RS 4
221 .nf
222 .fam C
223 sed \(aqs/#.*//\(aq /etc/fstab | column \-\-table \-\-table\-columns SOURCE,TARGET,TYPE,OPTIONS,PASS,FREQ \-\-table\-right PASS,FREQ
224 .fam
225 .fi
226 .if n .RE
227 .sp
228 Print fstab and hide unnamed columns:
229 .sp
230 .if n .RS 4
231 .nf
232 .fam C
233 sed \(aqs/#.*//\(aq /etc/fstab | column \-\-table \-\-table\-columns SOURCE,TARGET,TYPE \-\-table\-hide \-
234 .fam
235 .fi
236 .if n .RE
237 .sp
238 Print a tree:
239 .sp
240 .if n .RS 4
241 .nf
242 .fam C
243 echo \-e \(aq1 0 A\(rsn2 1 AA\(rsn3 1 AB\(rsn4 2 AAA\(rsn5 2 AAB\(aq | column \-\-tree\-id 1 \-\-tree\-parent 2 \-\-tree 3
244 1  0  A
245 2  1  |\-AA
246 4  2  | |\-AAA
247 5  2  | `\-AAB
248 3  1  `\-AB
249 .fam
250 .fi
251 .if n .RE
252 .SH "SEE ALSO"
253 .sp
254 \fBcolrm\fP(1),
255 \fBls\fP(1),
256 \fBpaste\fP(1),
257 \fBsort\fP(1)
258 .SH "REPORTING BUGS"
259 .sp
260 For bug reports, use the issue tracker at \c
261 .URL "https://github.com/karelzak/util\-linux/issues" "" "."
262 .SH "AVAILABILITY"
263 .sp
264 The \fBcolumn\fP command is part of the util\-linux package which can be downloaded from \c
265 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."