col command in Linux system is used to filter out reverse line feeds such that the output looks much more in the correct order with only forward and half forward line feeds and replaces the whitespace characters with tabs wherever possible. This can be proven useful in the processing of the output of nroff and tbl. The col utility simply reads from the standard input and writes to standard output.
col [-bfhpx] [-l num]
- col -b: This option do not show any backspaces. It will print only the last character written to each of the column position.
man import | col -b > readme1.txt
- col -f: This option will forward half line feeds which are permitted (“fine” mode). Normally characters printed on a half line boundary is being printed on the following line.
man cat | col -f > readme2.txt
- -h : This option does not allow to show multiple spaces instead of tabs.
man cp | col -h > readme3.txt
- -l num : This option will buffer at least num lines in memory. By default, 128 lines is buffered.
man chmod | col -l 29 > readme4.txt
- -p : This option will force unknown control sequences to be passed through unchanged. Normally, col will filter out any of the control sequences from the input other than those recognized and interpreted by itself.
man wget | col -p > readme5.txt
- -x : This option will going to output multiple spaces instead of tabs..
man mount | col -x > readme6.txt
- gcc command in Linux with examples
- cvs command in Linux with Examples
- gs command in Linux with Examples
- wc command in Linux with examples
- sum command in Linux with Examples
- ps command in Linux with Examples
- apt command in linux with examples
- w command in Linux with Examples
- tty command in Linux with examples
- pwd command in Linux with Examples
- du command in Linux with examples
- tar command in Linux with examples
- dc command in Linux with examples
- apt-get command in Linux with Examples
- fc Command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.