ack-grep show the matched files name only. Do not show the matched content
By Daniel Rodriguez •
I'm searching some keywords among minified files. It doesn't make sense to show those minified content. How could I use ack-grep 'SEARCH_WORD' and show the matched file names only
2 Answers
Both ack and grep have the -l option that shows only the filename. You can also use the -c to get a count of the matches in each file.
Note that if you're searching minified files, you may run into problems with ack because it specifically excludes many minified files. Run ack --dump | ack ignore to see what ack ignores.
The standard option grep -l (that is a lowercase L) could do this.
From the unix standard:
-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.Shameless stolen from this stackoverflow post.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"