How to Use Grep Recursively in a Unix Path
The "grep" command is a Unix-based command that allows you to find a text or numerical string within a certain file. Grep can only be used, by default, to search through a single set of files within one directory. Therefore, if you are unsure of the text string's location on your hard drive, you will need to use a recursive search. Recursive searches search the same string repeatedly until they are found. This also uses the "find" command.
Instructions
-
-
1
Open the Unix terminal. This process differs for each OS.
-
2
Type the following command:
find -name | xargs grep term
-
-
3
Replace "name" with the file name if you have one, otherwise leave it blank. Replace "term" with your search term.
-
4
Press "Enter" and wait until the result is displayed.
-
1