How to find files containing specific text in Linux?

Penguin by Lars Meiertoberens from the Noun Project If you would like to find a specific string of text within a directory of files, you can use the following command and example:

user@host:~$ grep -rnw '/path/to/directory/' -e 'searchterm'

Here's a breakdown of the example command and its parameters:

Sources

Share

Tags

~~DISCUSSION~~