Jeremy's Notes provides a first-hand experience of setting up, living in and maintaining a smart home. Jeremy shares his professional and personal experiences in and around the IT world, which he integrates into many aspects of his home and life.
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:
-Rwill recursively (within directories) look at all files within the specified path.
-nwill display the line number where the term shows up within each file.
-wMatches the whole word.