What you were attempting with a pipe works fine for me (tested in 26.1 and 25.3).
- Which version are you using?
- Does your command work outside of Emacs?
Edit: C-hv grep-use-null-device
might mess up your command, by preventing the second grep from reading stdin. This would be apparent in the command line displayed in the grep buffer. If this is the issue, then hopefully you can simply disable that option via the customize interface.
Failing that, you can always filter the results after the fact with the flush-lines
and keep-lines
commands, after toggling the read-only state with C-xC-q.
Personally I like/use the winnow library for streamlining that:
Use x to remove lines matching a pattern, or m to keep only the lines matching a pattern.
grep
in Emacs is justgrep
. It's whatever OSgrep
you have. There is an Emacs commandgrep
, but it just invokes your OSgrep
(and gives you nice access to the results etc.).grep
command doesn't invoke a shell, so things like in it won't work.