I know that stdout/stderr are a streams of data (uncommonly called "sources of data"), and that these streams of data also typically appear as terminal output.

After the stdout/stderr data appears in terminal (as different parts of the single stream), is it removed from stdout/stderr?

Note for newcomers; stdout/stderr (as well as stdin) are not generally regarded as "devices" even though sometimes, and in some situations, it is convenient to refer to them as such due to /dev/stdout.

closed as unclear what you're asking by Michael Homer, Anthony G - justice for Monica, RalfFriedl, G-Man Says 'Reinstate Monica', Thomas Nov 9 '18 at 9:36

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Is a source? Is the point to imply other sources are present? – KevinO Nov 8 '18 at 16:26
  • 1
    What's bad with the question now after editing?... – JohnDoea Nov 9 '18 at 19:47
  • (1) Stdin, stdout and stderr are not generally regarded as devices. The fact that you can (sometimes, in some situations) refer to /dev/stdout, etc., is just a convenience.  (2) Saying that stdout/stderr are “sources of data” is, at best, a very uncommon and somewhat distorted way of looking at it.  (3) Your question is like asking, “If I fill my glass with water from the sink, is the water removed from the faucet?” I hope this analogy will help you understand what you want to know. If it doesn’t, please do not respond in comments; edit your question to make it clearer and more complete. – G-Man Says 'Reinstate Monica' Nov 10 '18 at 11:19
  • Perhaps a better analogy would be “If I have a hole in my roof, and rain water comes into my home, is the water removed from the hole in the roof?” – G-Man Says 'Reinstate Monica' Nov 10 '18 at 11:29
  • 1
    @G-Man I edited the question per the essential data in your comments; I think the analogies are false and insulting. BTW, I thank you for noting Stdin, stdout and stderr are not generally regarded as devices. The fact that you can (sometimes, in some situations) refer to /dev/stdout, etc., is just a convenience and I wonder if this should be added as a note in subscript in the end of the question. – JohnDoea Nov 18 '18 at 1:38

Stdout and stderr are directed to the terminal by default. Stdin is directed from the terminal by default. They can be redirected (elsewhere) with >, < | etc.

Also, when you type textual (displayable) characters (on your keyboard), they are (usually) echoed to the terminal. (So a command is not the only source of terminal output.)

A note on copying

Does it mean that it is copied? No: this does not imply copying, but don't take this sentence to imply that it is not copied. Just know that it gets there. At some point the character codes are converted into pixels for display; up to then there may or may not be copying (copying is just an implementation detail).

Answer to revised question

Yes: stdout and stderr are streams (like a river, once part of the river has passed, it does not flow back. But unlike a river, you can make a copy as it passes.)

You can re-direct to somewhere else. If you want them to go to two places, then you can copy/duplicate them. tee is a good tool for this. E.g. ls | tee some-file will copy to some-file and write to stdout. Note some-file can be any file, e.g. /dev/stderr (if it exists on your system).

Not the answer you're looking for? Browse other questions tagged or ask your own question.