Finding all files containing a text string on Linux or Mac

I need to find some string in all folders.

[code lang=”bash”]
grep -rnw ‘./folder/’ -e “search-text”
[/code]

Note:

  • -r is recursive
  • -n is line number
  • -w stands match the whole word

Tags:

Leave a Comment

Your email address will not be published.

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