質問

when i do:

sudo strace -p PID 2>&1 | grep -v "recvmsg"

grep matches the lines it ought to match, but when i do:

sudo strace -p PID|grep -v "recvmsg"

It still shows all calls. Why is that?

役に立ちましたか?

解決

This is because strace writes all its output to stderr, not stdout. And a pipe redirects stdout, not stderr. So you need to redirect stderr of strace to stdout before piping to grep.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top