Stdout, Stderr, and Tee

November 10, 2007
shutterstock_10437106_rs

My friend Jason just posted a really cool command line trick > that lets you log stderr and stdout to different files while still having them visible in the console.

($command | tee /logs/stdout.txt) 3>&1 1>&2 2>&3 
| tee /logs/stderr.txt

Very cool.

supporting = loving

Since 1999 I've been creating ad-free technical tutorials and essays here. It's a one-person effort that's also my life and livelihood. If it makes your day more livable in any way, please consider supporting the work with a monthly or one-time donation. Your support means a lot to me, and makes all the difference. 🫶🏼