grep -A -B -C

   Linux中grep/egrep查找命令正則表達式

grep spa

--color    ###顏色着重顯示命中的文件及文件件code

-n  ###顯示行號  numberblog

-i   ###忽略大小寫 ignoreclass

-c  ###count統計出現匹配的次數grep

-E  ###標準posix,支持正則表達式   統計

grep -E   -v   '(^$|^#)' xxxx   等價於egrep -v '(^$|^#)'  xxx

-A   n    ###after     前面多少行di

-B   n   ###before    後面多少行文件

-C   n   ###centor    先後多少行co

學而思,思兒通,通則達!

相關文章
相關標籤/搜索