Celeb Glow
general | March 10, 2026

How to pipeline stderr in cmd.exe?

Some programs would prefer to output the help message in stderr. I want to search the help message with grep command, xx /? | grep regex?

How could i do this?

1 Answer

You can redirect stderr to stdout by using 2>&1, and then pipe stdout into grep.

So, what I think you want is this:

xx /? 2>&1 | grep regex
4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy