English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux col command

Linux Command大全

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

Many UNIX documentation files contain RLF control characters. When we use shell special characters '>/' and '>>' to output the content of the documentation files as plain text files, the control characters become garbled. The 'col' command can effectively filter out these control characters.

Syntax

col [-bfx][-[l<Buffer Column Number>] 

Parameters:

  • -b Filter out all control characters, including RLF and HRLF.
  • -f Filter out RLF characters, but allow the presentation of HRLF characters.
  • -x Represents the tab character with multiple space characters.
  • -l<Buffer Column Number> The default memory buffer has128Columns, you can specify the buffer size yourself.

Online Examples

The following takes the help document of the 'man' command as an example to explain the usage of the 'col' command.

Save the help document of the 'man' command as 'man_help' using-The 'b' parameter filters all control characters. Use the following command in the terminal:

man man | col-b > man_help  

Note:The '|' symbol is used to create a pipeline, converting the output of the 'man' command into input data for the 'col' command.

Linux Command大全