1.\" $OpenBSD: column.1,v 1.18 2016/10/24 13:53:05 schwarze Exp $ 2.\" $NetBSD: column.1,v 1.3 1995/03/26 09:08:28 glass Exp $ 3.\" 4.\" Copyright (c) 1989, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)column.1 8.1 (Berkeley) 6/6/93 32.\" 33.Dd $Mdocdate: October 24 2016 $ 34.Dt COLUMN 1 35.Os 36.Sh NAME 37.Nm column 38.Nd columnate lists 39.Sh SYNOPSIS 40.Nm column 41.Op Fl tx 42.Op Fl c Ar columns 43.Op Fl s Ar sep 44.Op Ar 45.Sh DESCRIPTION 46The 47.Nm 48utility formats its input into multiple columns. 49Each input line provides the text for one output cell. 50Columns are filled before rows. 51.Pp 52The column width is determined by the longest input line rounded 53up to the nearest tabstop; tabstops are assumed to be at multiples 54of eight. 55Output uses tab characters to advance to the next column. 56The number of columns is chosen to fill the terminal width. 57.Pp 58Input is taken from 59.Ar file 60operands or, by default, from the standard input. 61Empty lines and lines containing only whitespace are ignored. 62.Pp 63The options are as follows: 64.Bl -tag -width Ds 65.It Fl c Ar columns 66Output is formatted for a display 67.Ar columns 68wide. 69.It Fl s Ar sep 70Specify a set of characters to delimit columns for the 71.Fl t 72option. 73It defaults to space and tab. 74.It Fl t 75Table mode. 76Each input line provides the text for one output row. 77It is split into cells using the 78.Fl s 79option. 80Leading, trailing, and multiple adjacent delimiters are ignored. 81Each column is as wide as the widest cell in it. 82Columns are separated by two spaces. 83.It Fl x 84Fill rows before filling columns. 85.El 86.Sh ENVIRONMENT 87.Bl -tag -width LC_CTYPE 88.It Ev COLUMNS 89If set to a positive integer, 90output is formatted to the given width in display columns. 91Otherwise, 92.Nm 93defaults to the terminal width, or 80 columns if the output is not a terminal. 94.It Ev LC_CTYPE 95The character encoding 96.Xr locale 1 . 97It decides which byte sequences form characters, what their display 98width is, and which characters are whitespace. 99If unset or set to 100.Qq C , 101.Qq POSIX , 102or an unsupported value, each byte except the tab is treated as a 103character of display width 1. 104.El 105.Sh EXIT STATUS 106.Ex -std column 107.Sh SEE ALSO 108.Xr colrm 1 , 109.Xr fmt 1 , 110.Xr paste 1 , 111.Xr rs 1 112.Sh HISTORY 113The 114.Nm 115command appeared in 116.Bx 4.3 Reno . 117