Standard stream

1. What does “standard” mean in stderr / stdout?

Standard” comes from the Unix philosophy (“standard streams”).

Every program automatically starts with three built-in streams:

NameAbbrevFDMeaning
Standard Inputstdin0Where the program reads input
Standard Outputstdout1Normal program output
Standard Errorstderr2Error, warning, panic messages


The term “standard” just means:

These streams are available by default for every program.

No special setup needed.

Redirecting stderr

You often see:

2>&1

This means:

Redirect file descriptor 2 (stderr) into file descriptor 1 (stdout)

So now stdout + stderr both go to the same place.

Using tee


tee is a Unix command that lets you see output live AND save it to a file at the same time.


Example logging:

my_program > log.txt 2>&1


or with live view:

my_program 2>&1 | tee log.txt

Leave a Reply

Your email address will not be published. Required fields are marked *