Linux col命令
Linux 教程
· 2019-02-14 11:14:47
Linux col命令用于过滤控制字符。
在许多UNIX说明文件里,都有RLF控制字符。当我们运用shell特殊字符">"和">>",把说明文件的内容输出成纯文本文件时,控制字符会变成乱码,col指令则能有效滤除这些控制字符。
语法
col [-bfx][-l<缓冲区列数>]
参数:
- -b 过滤掉所有的控制字符,包括RLF和HRLF。
- -f 滤除RLF字符,但允许将HRLF字符呈现出来。
- -x 以多个空格字符来表示跳格字符。
- -l<缓冲区列数> 预设的内存缓冲区有128列,您可以自行指定缓冲区的大小。
实例
下面以 man 命令帮助文档为例,讲解col 命令的使用。
将man 命令的帮助文档保存为man_help,使用-b 参数过滤所有控制字符。在终端中使用如下命令:
man man | col-b > man_help
注:其中"|"用于建立管道,把man命令的输出结果转为col命令的输入数据。
点击查看所有 Linux 教程 文章: https://codercto.com/courses/l/14.html
Programming Amazon Web Services
James Murty / O'Reilly Media / 2008-3-25 / USD 49.99
Building on the success of its storefront and fulfillment services, Amazon now allows businesses to "rent" computing power, data storage and bandwidth on its vast network platform. This book demonstra......一起来看看 《Programming Amazon Web Services》 这本书的介绍吧!