- Unsupervised Learning
- Posts
- Stdout, Stderr, and Tee
Stdout, Stderr, and Tee
![shutterstock_10437106_rs](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/06570367-54e8-4a89-a965-c132ed47acf9/shutterstock_10437106_rs.jpg)
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.