What’s exactly the default stdin, stdout and stderr in a typical Linux system?

I’ve heard in some occasions that the default stdin is the keyboard and that the default stdout and stderr is the screen, but I find that is pretty innacurate.

If that were absolutely accurate I think that a command like cp file /dev/stdin would never be allowed and that if stdout and stderr where the screen then I should be able to control exactly what it might display (which sounds pretty risky by the way).

So, I’m more into defining that the default stdin is the way the current active terminal has for entering text from the user, stdout the way the current active terminal has for showing text that is not an error on the execution of a command to the user and stderr the way the current active terminal has for showing text that is an error on the execution of a command to the user. But even them this might not be exactly accurate.

Is my definition correct about what specifically stdin,stdout and stderr are in a typical linux system or is there something that defines better what those things are?

Thanks for your attention.

Answer

Attribution
Source : Link , Question Author : user2638180 , Answer Author : Community

Leave a Comment