How can I pipe stderr, and not stdout?

First redirect stderr to stdout — the pipe; then redirect stdout to /dev/null (without changing where stderr is going): command 2>&1 >/dev/null | grep ‘something’ For the details of I/O redirection in all its variety, see the chapter on Redirections in the Bash reference manual. Note that the sequence of I/O redirections is interpreted left-to-right, … Read more