Finding variables etc with grep

4 August 2021

When exploring an unfamiliar codebase it is often desirable to see where variables, functions, and the like are used. Some IDEs will help you to do this easily but grep also works well for this.

In your folder:

grep -iIr "string" ./*

From the man page:

-i      Ignore case	
-I      Ignore binary files
-r      Recursively search subdirectories listed