4 ms·
Personally, I often use grep to filter results of a pipeline: some | commands | grep ERROR In fact I do this so often that I have it aliased to g: alias
by adambyrtek 8y ago
Personally, I often use grep to filter results of a pipeline:
some | commands | grep ERROR
In fact I do this so often that I have it aliased to g:
alias g=grep
Maybe I could achieve the same with ack/ag/ripgrep, but I somehow mentally associate these tools with searching over a filesystem.
- jolmg 8y agoThey're really meant for the same thing. You can also search the filesystem with grep by using -R and providing a path explicitly like `grep -R pattern .`. EDIT: The real differences (at least the most important ones for me) between grep and these tools are 1) they format filesystem searches better for human viewing, 2) they provide more useful defaults, 3) in the case of ag, you can specify a max line width to avoid the terminal being filled by a matching line that has a ridiculous length, which typically happens with generated files, 4) they're supposed to be faster although I personally don't have searches big enough to notice the difference, but I imagine it's a big deal to others.