close

1. cat build.log | grep -m2 -n "Fetch"

21:Fetching project android/device/realtek/firmware
22:Fetching project aosp/platform/external/robolectric
 

-n : 列出行號

-m2: 只列出前兩個符合的, 數字可以自行調整

 

2. grep --exclude-dir=".svn" *

省略 .svn目錄

 

3. grep -i "hello" sample

忽略大小寫

 

arrow
arrow
    文章標籤
    bash grep
    全站熱搜

    Orion 發表在 痞客邦 留言(1) 人氣()