top | item 30130255

Ask HN: Grep like tools for full text search?

9 points| joiguru | 4 years ago

Hello,

Like many in this community, I maintain my notes in text files. I am looking for command line tools that I can use to index and search them.

Are there existing tools that do that? My google skills are are not producing good results.

Thanks

8 comments

order

bariumbitmap|4 years ago

I use Recoll:

https://www.lesbonscomptes.com/recoll/

There is a GUI, but it has a perfectly serviceable command-line interface as well. For example, this command lists all files with the exact phrase 'moved permanently':

    recoll -t -l '"moved permanently"'
And this command finds all files ending in '.py' and under a directory called 'Dropbox' that contain the exact words "import" and "logging":

    recoll -t -l "ext:py dir:Dropbox/ Import Logging"
It can take some time and effort to configure, but I have found it to be well worth it.

Noumenon72|4 years ago

Why not grep? Are you saying you want full text search with like, stemming and result ranking?

If I can piggyback on your question, my notes are in Word files and I sure wish I could grep those. I bet none of the answers at https://superuser.com/questions/70343/grep-in-microsoft-word work any more because Microsoft will keep changing the file format.

motyar|4 years ago

You search inside file using grep.

grep -Ril "term"

dunefox|4 years ago

Ripgrep is good.

masukomi|4 years ago

ripgrep is, great, but it's a regexp search not full text. Full text search includes stemming.