grep命令小結

grep "cai" test --color -i

egrep "xiao|liang" test --color -i

grep "xiao|liang" test --color -i -E

grep "k$" test --color -i

grep "^f" test --color -i

grep "c.i.." test --color -i



--color:以顏色標記出來

-i:不區別大小寫

-E:匹配多個

^:行開頭

$:行結尾

^$:空白行

.:一個字符除了換行符

*:它前面的字符出現0次或多次

+:它前面的字符最少出現1次


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章