Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command col

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the usage of the Linux basic command col". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Col

When you filter out the control characters that affect reading and use redirects to output the contents of the instruction manual to a text file, the control characters become garbled. The col instruction filters out control characters to make the text readable. Col reads content from tile input and outputs to standard output. Col tracks the character set as it reads characters and ensures that the character set is correct when output. If the input attempts to back up to the last refresh line, col displays a warning message.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Col [- bfpx] [- lnum] file

2. List of options

Option

Description

-- version

Display command version information

-- help

Show help documentation

-b

Filter all control characters

-f

Filter out RLF characters and ignore HRLF characters

-p

Ignore unknown control characters

-x

Replace multiple spaces with tab

-lnum

Sets the buffer size, defaults to 128 lines

3. Examples

The manual of the clear instruction is filtered and output to a text file

[root@192 weijie] # man clear > 3.c / / direct the manual from to the file

[root@192 weijie] # vim 3.c / / Editing the file, there are a lot of garbled codes inside, these are control characters

Clear (1) clear (1)

N ^ HNA ·Ham ·HME ·HE

C ^ HL ^ Hel ^ HA ^ HR-clear the terminal screen

S ^ HSY ^ Hyn ^ HNOP ^ HPS ^ HSI ^ HISHS

C ^ HC ^ Hle ^ he ^ HA ^ HR

D ^ HDE ^ HS ^ HSC ^ HCR ^ HRI ^ hip ^ hip ^ HTI ^ HIO ^ Honn

C ^ HC ^ HL ^ he ^ HA ^ HR clears your screen if this is possible. It looks in the environ-

Ment for the terminal type and then in the t ^ HTE ^ HRM ^ HIN ^ HNF ^ HF ^ Ho database to figure

Out how to clear the screen.

[root@192 weijie] # man clear | col-b > 3.c / / after filtering the contents of the manual, direct to the file

[root@192 weijie] # vim 3.c / / Edit the contents of the file without garbled code

Clear (1) clear (1)

NAME

Clear-clear the terminal screen

SYNOPSIS

Clear

DESCRIPTION

Clear clears your screen if this is possible. It looks in the environ-

Ment for the terminal type and then in the terminfo database to figure

Out how to clear the screen.

This is the end of the introduction to "the usage of the Linux basic command col". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report