Command Line Full Text
For occasional searches you’d use grep. Something like:
grep --ignore-case --files-with-matches --recursive foo /some/file/path
This can take quite a while. There are some tweaks to grep you can add, but for source code, ack
is traditional. Even faster is ag
a.k.a. The Silver Searcher (get it, ag - is silver in the periodic table… and possibly a play on words with The Silver Surfer)
apt install silversearcher-ag
# Almost a drop in for grep
ag --ignore-case --files-with-matches --recurse foo /some/file/path
You’d think an index would be great - but then you realize that for unstructured text (i.e. full test searching) you have to build an index of every word in every file that the index is larger than the contents.
Though lucene/elasticseach and spinx come up in conversation.
Links
https://github.com/ggreer/the_silver_searcher
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.