How do I find files containing a specific text on Linux systems?

0 Comments

The easiest way is via your favourite terminal app (aka the CLI):

  • Navigate into the directory you want to search
  • Enter
    grep -iRl "[text string]" .

The output will be a list of files (if any) containing the exact [text string] you specified.

To clarify the ‘-iRl’:

  • i: ignore text case
  • R: recursive. search the current folder, and all subdirectories
  • l: return file names instead of sniplets of code
116 views
Was this answer helpful ? Yes (1) / No (0)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

reduction