[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