Friday, January 19, 2018

How do I find all files containing specific text on Linux?

grep -rnw '/path/to/somewhere/' -e 'pattern'  
or

    grep -r YOUR_PATTERN .
or
find /path/to/somewhere -type f -exec grep -H 'text-to-find-here' {} \;

Reference:
https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux

No comments:

Post a Comment