Grep list only unique filenames

To list unique filenames using grep, do the following:

grep -irl "search-term" .

 

Notice the ‘l’ flag, short for –files-with-matches, defined as “Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match.”

The i flag just makes the search case-insensitive, and r is recursive.

ABOUT THE AUTHOR

Anthony Leon

Author has no description.

NO COMMENTS

Leave a comment

Your email is never published or shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>