3 ms·
A little bit off topic, but I’ve always wanted a “simple” CLI tool that works exactly like grep (same flags and regex support), but rather than filtering the re
by philo23 3y ago
A little bit off topic, but I’ve always wanted a “simple” CLI tool that works exactly like grep (same flags and regex support), but rather than filtering the result, it just highlights the matches in the output.
I’ve not found anything like that yet though, closest I’ve come is using grep with the before/after/context flag with a high number of lines or using search in less, but I want to do something like...
tail -f access.log | highlight ".jpg"
Maybe I’ve just not found the right flag for grep yet...
Edit: Thank you everyone for your suggestions, you've all been very helpful! And apologies again for hijacking the topic, tailspin looks very neat.
- CubsFan1060 3y agoTry | less -p ".jpg"
- deleted 3y ago[deleted]
- svedin 3y agoripgrep has a --passthru flag that does exactly this tail -f access.log | rg --passthru '\.jpg'
- loudmax 3y agoThis is how I colorize with grep: cat <file> | grep -E --color "<regex>|$" Where `<regex>` is your pattern.
- ralgozino 3y agoadding "or an end of the line" to the regex is pretty clever, I'm stealing it :) thanks!
- quickthrower2 3y agoObligatory “you don’t need cat”
- jstanley 3y agoI wrote this years ago: https://github.com/jes/emph https://github.com/jes/emph
- pdimitar 3y agoA Markdown README and some screenshots will really help.
- deleted 3y ago[deleted]