Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux col Command

Linux col Command

Linux Command Reference Linux Command Reference

The Linux col command is used to filter out control characters.

Many UNIX manual pages contain RLF control characters. When we use the shell special characters ">" and ">>" to output the content of a manual page to a plain text file, the control characters turn into garbled text. The col command can effectively filter out these control characters.

Syntax

col [-bfx][-l<缓冲区列数>] 

Parameters:

Example

The following uses the help documentation of the man command as an example to explain the use of the col command.

To save the help documentation of the man command as man_help and use the -b option to filter out all control characters, use the following command in the terminal:



man man | col-b > man_help  

**Note: **Here "|" is used to create a pipe, converting the output of the man command into input for the col command.

Linux Command Reference Linux Command Reference