ack-grep show the matched files name only. Do not show the matched content
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3
--
Chapters
00:00 Ack-Grep Show The Matched Files Name Only. Do Not Show The Matched Content
00:18 Answer 1 Score 2
00:40 Accepted Answer Score 22
01:02 Thank you
--
Full question
https://superuser.com/questions/1231059/...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#grep #ack
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3
--
Chapters
00:00 Ack-Grep Show The Matched Files Name Only. Do Not Show The Matched Content
00:18 Answer 1 Score 2
00:40 Accepted Answer Score 22
01:02 Thank you
--
Full question
https://superuser.com/questions/1231059/...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#grep #ack
#avk47
ACCEPTED ANSWER
Score 22
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.
ANSWER 2
Score 2
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.