Pipes & Redirects (| > >> 2>&1) Playground

The Warnet Desa’s work desks: stdout and stderr are two chutes. > 2> 2>&1 /dev/null | grep run in a model bash; watch each line land on the screen, in a file…

Why it matters

"I redirected it to a file but the error still shows", "grep does not catch my error", "my log emptied itself": three of the most common shell puzzles, and all three are about two streams and the order of redirections.

The key idea

> moves stdout only, and bash reads redirections from the left

Common mistakes

Try it in this playground