标准选项
grep -l(即小写的L)可以做到这一点。
根据Unix标准:
-l (The letter ell.) Write only the names of files containing selected lines to standard output. Pathnames are written once per file searched. If the standard input is searched, a pathname of (standard input) will be written, in the POSIX locale. In other locales, standard input may be replaced by something more appropriate in those locales.
-H在这种情况下,您也不需要。



