如何使用grep在Linux上顯示文件名? - How can I use grep to show just filenames on Linux?

問題:

How can I use grep to show just file-names (no in-line matches) on Linux? 如何在Linux上使用grep來顯示文件名(沒有內聯匹配)? php

I am usually using something like: 我一般使用相似的東西: this

find . -iname "*php" -exec grep -H myString {} \;

How can I just get the file-names (with paths), but without the matches? 我怎樣才能得到文件名(帶路徑),但沒有匹配? Do I have to use xargs ? 我必須使用xargs嗎? I didn't see a way to do this on my grep man page. 我沒有在grep手冊頁上看到這樣作的方法。 spa


解決方案:

參考一: https://stackoom.com/question/Rqoc/如何使用grep在Linux上顯示文件名
參考二: https://oldbug.net/q/Rqoc/How-can-I-use-grep-to-show-just-filenames-on-Linux
相關文章
相關標籤/搜索