Is there such a thing as cached grep?
1 answer
It sounds like you really need a pipeline. Grep handles this use case well, allowing you to re-filter previously filtered results by accepting data on standard input.
For example:
# Search for "bar" in lines that have "foo."
grep foo * | grep bar
# Search for "baz" in lines that don't have "quux."
grep -v quux * | grep baz
0
source to share