Latest web development tutorials

Linux col command

Linux command Daquan Linux command Daquan

Linux col command filters control characters.

In many UNIX documentation, the RLF has control character. When we use shell special characters ">" and ">>", the output documentation into a plain text file, control characters will become garbled, col command is able to effectively filter out these control characters.

grammar

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

Parameters:

  • -b filter out all control characters, including the RLF and HRLF.
  • -f filtered RLF character, but allows HRLF characters presented.
  • -x with more space characters to represent the tab character.
  • -l <buffer number of columns> preset memory buffer is 128, you can specify the size of the buffer themselves.

Examples

The following man command help document, for example, explain the use of col command.

Save the document as man_help help man command, using the -b parameter filtering all control characters. Use the following command in Terminal:

man man | col-b > man_help  

Note: where "|" is used to establish pipe the output to input data into the command man col command.

Linux command Daquan Linux command Daquan