Linux基礎命令---文字過濾col
col
過濾掉影響閱讀的控制字元,使用重定向符把說明手冊的內容輸出到文字檔案時,控制字元就成亂碼。col指令可以過濾掉控制字元,使文字可讀。col從標磚輸入讀取內容,輸出到標準輸出。col在讀取字元時跟蹤字符集,並確保字符集在輸出時是正確的。如果輸入試圖備份到最後一條重新整理行,col將顯示一條警告訊息。
此命令的適用範圍:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。
1、語法
col [-bfpx] [-lnum] file
2、選項列表
選項 |
說明 |
--version |
顯示命令版本資訊 |
--help |
顯示幫助文件 |
-b |
過濾所有的控制字元 |
-f |
過濾掉RLF字元,忽略HRLF字元 |
-p |
忽略未知的控制字元 |
-x |
將多個空格用tab代替 |
-lnum |
設定緩衝區大小,預設128行 |
3、例項
將clear指令的手冊經過過濾,輸出到文字檔案
|