grep查找文件中的內容
命令格式:grep "要查找的內容" filename
-i 不區分大小寫
-n (line number)顯示行號
-c (count)顯示有幾條匹配的
-v (invert match) 反向匹配,查找的不是你要查找的內容
-H(Print the file name for each match. This is the default when there is more than one file to search.)打印匹配到的文件名,默認選項,在超過一個文件中有的時候是默認選項
遞歸搜索某個目錄以及子目錄下的所有文件
命令格式:grep –r "被查找的字符串" 文件目錄
實驗效果: