Full-Text Search in Multiple Directories Using Grep
I am having around ~200 project directories in my ~/Developer directory and sometimes I remember that I have written some function or feature, but can't remember for which project it was. Luckily it's super easy to do a full-text search using the command line tool grep.
grep -r -I --exclude-dir=node_modules getStreak futureland*
Let me break it down:
-rRecursively search subdirectories listed-IIgnores binary files, which improves performance. They are not important for my search anyways.--exclude-dir=node_modulesExcludesnode_modulesdirectories as what I am looking for cannot be found in it.getStreakthe text/string I am looking forfutureland*will search in all directories and their children that start withfutureland