JSI Tip 9206. More on suppressing output to Stdout and Stderr.

In tip 2996 ยป How do I prevent a command from displaying any output, including any error message, I explained that using 1>nul 2>&1 would pipe both Stdout and Stderr to nul, suppressing any output from the piped command.

I also pointed out that > defaults to 1>.

Using these principals, you can save a keystroke when attempting to suppress Stdout and Stderr by using >nul 2>&1 or 2>nul >nul.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.