0

Like results in an Internet search engine. But this analogy is given only to explain what I mean under preview snippets. In other aspects I'm looking for a regular search with exact match and local text files, preferably with regexp support. Also I'd like to be able to specify how much lines or words to display around each result. I'm looking for a FOSS cross-platform application.

So far I found Notepad++'s Find in Files, but it shows only one line and is not cross-platform.
Then at this question I found AstroGrep, it does the job well, but isn't yet ported to Unices too.
Then I found this question and the correspondent Wikipedia list, yet those products seem bloated, I'm looking for a lightweight tool without browser interface, indexing, and such.

1 Answer 1

1

Personally I love grin which is a python library & command line tool, no GUI I am afraid.

  • Free, gratis & Open Source
  • Cross platform OK you need to install python on windows
  • Uses python regular expressions (very powerful)
  • You can specify the number of lines before, after or both to show for each match.
  • Automatically recursive
  • Automatically skips version control directories such as .svn, .git, etc.
  • You can specify file name patterns in a Unix glob manner, (even on Windows).
  • Can recurse into tar.gz files for matches.
  • Once you have python installed a simple pip install grin installs it for you, possibly prefixed with sudo.

Help output:

enter image description here

1
  • Apart from not having GUI, it currently can't handle Unicode text files, so I won't accept it as the solution, but it is still useful, so thanks anyway. Also I had to install it using pip2, it isn't compatible with Python 3 for now.
    – user
    Commented Feb 3, 2017 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.