"Linux" character conversion command col

Source: Internet
Author: User
Tags control characters

[email protected] ~]# Col [-XB] Options and Parameters:-x: Converts the TAB key to the equivalent space bar-B: Filter out all control characters, including RLF (Reverse line Feed) and HRF (Halt RLF)Example one: UsingCat-A shows all the special keys, and finally the [tab] is turned into blank with col [[email protected]~]#Cat-a/etc/Mans. config <== you'll see a lot of ^symbol of I, that is tab[[email protected]~]#Cat/etc/Mans. config | Col-x |Cat-A | More# Hey! As a result, the [tab] key will be replaced with a space bar, the output is much more beautiful! Example two: Put Col'sMansPage dumps become/root/col.Mansplain text file [[email protected]~]#MansCol >/root/col.Mans[[Email protected]~]#VI/root/col.MansCOL (1) BSD General Commands Manual COL (1) N^hna^ham^hme^HE C^HCO^HOL^HL-filter Reverse line feeds from InputS^hsy^hyn^hno^hop^hps^hsi^his^HS C^HCO^HOL^HL [-^H-B^HBF^HFP^HPX^HX] [-^h-l^hl _^hn_^hu_^hm]#, you're not mistaken! BecauseMansThere are special buttons in the page that will be used as special keys and colors to display, # So this file will appear in a bunch of weird characters like the one above (with^of) [[Email protected]~]#MansCol | Col-b >/root/col.Mans

Although Col has his special purpose, however, many times he can be used to simply handle the [tab] key instead of becoming the SPACEBAR! For example, in the example above, if you use CAT-A, [tab] is represented by ^i. But after col-x processing, the [tab] will be replaced as the equivalent of the space bar! In addition, col is often used to dump the man page into a plain text file for easy access ! As shown above in example two!

  Reference:http://vbird.dic.ksu.edu.tw/linux_basic/0320bash.php#col

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.