COL(1) | General Commands Manual | COL(1) |
col
— filter
reverse line feeds from input
col |
[-bfhpx ] [-l
num] |
The col
utility filters out reverse (and
half reverse) line feeds so that the output is in the correct order with
only forward and half forward line feeds, and replaces white-space
characters with tabs where possible.
The col
utility reads from the standard
input and writes to the standard output.
The options are as follows:
-b
-f
-h
-l
num-p
col
will filter out any control sequences from the
input other than those recognized and interpreted by itself, which are
listed below.-x
In the input stream, col
understands both
the escape sequences of the form escape-digit mandated by
Version 2 of the Single UNIX Specification
(“SUSv2”) and the traditional
BSD format escape-control-character. The control
sequences for carriage motion and their ASCII values are as follows:
-f
mode, this sequence may also occur in the output stream.All unrecognized control characters and escape sequences are discarded.
The col
utility keeps track of the
character set as characters are read and makes sure the character set is
correct when they are output.
If the input attempts to back up to the last flushed line,
col
will display a warning message.
The LANG
, LC_ALL
and LC_CTYPE
environment variables affect the
execution of col
as described in
environ(7).
The col
utility exits 0 on success,
and >0 if an error occurs.
We can use col
to filter the output of
man(1) and remove the backspace characters
( ^H ) before
searching for some text:
man ls | col -b | grep HISTORY
The col
utility conforms to
Version 2 of the Single UNIX Specification
(“SUSv2”).
A col
command appeared in
Version 6 AT&T UNIX.
October 21, 2020 | macOS 15.0 |