Although Eclipse does provide a lot of facilities for Finding content is Workspace files, it maybe less efficient for find something such as a certain package or class usage. Actually we could do it more efficient and geeky.
Now we use the classic Unix command grep.
1 2 3 4 5 6 |
|
Let’s take a look at the command arguments explanation.
-E, —extended-regexp Interpret pattern as an extended regular expression (i.e. force grep to behave as egrep).
-R, -r, —recursive Recursively search subdirectories listed.
—colour=[when, —color=[when]] Mark up the matching text with the expression stored in GREP_COLOR environment variable. The possible values of when can be
never
,always
orauto
.-n, —line-number Each output line is preceded by its relative line number in the file, starting at line 1. The line number counter is reset for each file processed.
Is this trick awesome? Save it as a bash script named quickfind.sh.
1 2 |
|
Then let it executable and just run it.
1 2 |
|