3 ms·
Anyone know of a tool like ack/ag which also lets me search for a term in proximity to another?" For example, find <foo> within 5 lines of <bar>"
by clumsysmurf 13y ago
Anyone know of a tool like ack/ag which also lets me search for a term in proximity to another?" For example, find <foo> within 5 lines of <bar>"
- andrelaszlo 13y agoI guess you could setup Sphinx to index your code :) "If it's worth doing, it's worth overdoing!" http://sphinxsearch.com/ http://sphinxsearch.com/
- ekns 13y agoYou could do this with grep or ack or ag: grep bar -A 5 -B 5 files... | grep foo -A n prints n lines following the match (bar) and -B n prints n lines before the match.
- bencoder 13y ago-C x does the same as both -A x and -B x together (A - after, B - before, C - context)