Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the common command col in Linux

Shulou Source: shulou.com Published: 2022-06-01 17:13:14 11月01日 Update

This article mainly shows you "Linux common command col how to use", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux common command col how to use" this article.

Linux common commands col commands are used to filter control characters, and there are RLF control characters in many UNIX documentation. When we use the shell special characters ">" and "> >" to output the contents of the description file into a plain text file, the control characters will become garbled, and the col instruction can effectively filter out these control characters.

Syntax col [- bfx] [- l] parameter:

-b filter out all control characters, including RLF and HRLF.

-f filters out RLF characters, but allows HRLF characters to be rendered.

-x represents a tabbed character as multiple space characters.

-l the default memory buffer has 128 columns. You can specify the size of the buffer.

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

Save the help document for the man command as man_help and use the-b parameter to filter all control characters. Use the following command in the terminal:

Man man | col-b > man_help Note: where "|" is used to establish a pipeline to convert the output of the man command into the input data of the col command.

The above is all the contents of the article "how to use Linux commands col". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Commands characters controls common use content help files articles parameters documents buffers learning buffering output valid special garbled memory multiple size Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Tech Info Apple MySQL vpn