Command: grep-l & lt; string_or_regex & gt; & lt; file_pattern & gt; the meaning of the-l parameter (lower case L) is as follows: mangrep writes-l, -- files-with-matchesSuppressnormaloutput; insteadprintthenameofeachinputfil...
Command: grep-l
The meaning of the-l parameter (lower case L) is as follows:
Man grep wrote
-L, -- files-with-matches
Suppress normal output; instead print the name of each input file from which output wocould normally have been printed. The scanning will stop on the first match.
Because the first match will stop scanning the file content, the efficiency is quite high. Find the file and use other tools to view the specific content of the file.
Example:
Grep-l SELECT NSI.LOG.2011-09 -*
Grep-l 'nsadduser. * CRM 'NSI.LOG.2011-08 -*
Grep-l 'nsadduser. * CRM 'NSI.LOG.2011-08-2 *
[Root @ db1 logs] # grep-l 'nssadduser. * CRM 'NSI.LOG.2011-08-2 *
NSI.LOG.2011-08-22-08
NSI.LOG.2011-08-22-09
NSI.LOG.2011-08-22-10
NSI.LOG.2011-08-23-09
NSI.LOG.2011-08-25-09
NSI.LOG.2011-08-25-10
NSI.LOG.2011-08-26-08
NSI.LOG.2011-08-26-09
[Root @ db1 logs] #