| 常用 Text 處理指令 |
|---|
| 指令 | 意義
echo
將後面帶的字串於 STDOUT 印出
cat
串接檔案,輸出於STDOUT 上
less
more
將檔案內的內容以一頁一頁的方式展示於STDOUT上
grep
egrep fgrep
篩出符合給定字串的橫行
grep可使用Basic Regular Expressions (BREs)於字串比對 egrep可使用Extended Regular Expressions (EREs) fgrep為快速版 grep
cut
paste
垂直欄位剪貼
cut 為垂直切片 paste 將給定的檔案以左右並排方式合併
sort
排序
uniq
刪除重複的橫行
tr
字元轉換
wc
計算行數、字數、字元數等
expand
unexpand expand 將 tab 改成空白 unexpand 相反操作
cmp
比較兩個檔案
iconv
從STDIN或指定檔案讀取的字元轉換為另一個編碼字集
join
將兩個檔案根據匹配的欄位合併為一個檔案
sed
一種非互動式的編輯器
awk
一種優雅且有用的程式語言,特別適合處理有欄位的資料
spell
拼字檢查
tee
將送到STDOUT的資訊複製到檔案中
|
|---|
| Text Manipulation Commands |
|---|
| 指令 | 意義
echo
Print arguments to standard output.
cat
Concatenate files.
less
more
Sophisticated interactive pager programs for looking at information on
a terminal, one screenful (or "page") at a time.
grep
egrep fgrep
篩出符合給定字串的橫行
grep可使用Basic Regular Expressions (BREs)於字串比對 egrep可使用Extended Regular Expressions (EREs) fgrep為快速版 grep
cut
paste
cut vertically
paste multiple files in parallel
sort
Sort text files.
specification and priority.
uniq
Remove or count duplicate lines in sorted input.
tr
A character
translation program.
wc
Count lines, words, characters, and/or bytes.
expand
unexpand
Converting tab into space and vice versa.
cmp
Simple file comparison program.
iconv
General-purpose character-encoding conversion tool.
join
Join matching records from multiple files.
sed
A stream editor, based on the original ed line editor's command set.
awk
An elegant and useful programming language in its own right, it is also
an important component of many large shell scripts.
spell
A batch spellchecker.
tee
Copy STDIN to STDOUT and to one or more named output files.
|
|---|