grep -nr <x> <folder>
One killer feature of any IDE is the ability to jump to a symbol definition in a different file. Sadly, this feature is not always available out of the box (Looking at you Sublime!). Until that day, here's a simple grep I use often to find function definitions or calls.
grep -nr awesome() .
This will search for all occurrences of awesome()
in your app and includes the line number with the -n
flag. The -r
flag ensures recursively traversing your folders.
Add the --color
flag if your terminal isn't already showing colors :)
Written by Marc Kuo
Related protips
1 Response
I use ctags
to do the job. The richer information can also be leveraged by VIM to jump automatically
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#