Standard Output
Part of the Fundamentals section of Coddy's Terminal journey — lesson 37 of 82.
Every command in the terminal has three data streams connected to it. Understanding these streams is the foundation of redirection — one of the most powerful features of the command line.
The first stream is called standard output, often abbreviated as stdout. This is where commands send their normal results. When you run ls or cat, the text you see on screen is coming through standard output.
echo "Hello, World!"The message Hello, World! is sent to standard output, which by default displays on your terminal screen.
Similarly, when you list files:
lsThe list of filenames flows through standard output to your screen.
By default, standard output is connected to your terminal display. But here is where it gets interesting — you can redirect this output somewhere else, like into a file. Instead of seeing the results on screen, you can capture them for later use.
In the upcoming lessons, you will learn how to redirect standard output to files, and discover the other two streams: standard input and standard error.
Challenge
EasyUse the echo command to send a message to standard output. Print the following text exactly:
Terminal streams are powerfulHint: Use
echofollowed by the text in quotes. The output you see on screen is coming through standard output (stdout).
Cheat sheet
Every command in the terminal has three data streams connected to it:
- Standard output (stdout): where commands send their normal results
By default, standard output displays on your terminal screen:
echo "Hello, World!"lsStandard output can be redirected to other destinations, such as files, instead of displaying on screen.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Directories
Create A DirectoryCopy A DirectoryMove And Rename A DirectoryDelete A DirectoryRecap - Directory Operations7File Content
Head And TailWord CountSort CommandUnique CommandGrep BasicsGrep With FlagsRecap - Text Detective2Navigation
Print Working DirectoryList FilesChange DirectoryAbsolute vs Relative PathsHome And Root DirectoryRecap - Find Your Way8Redirection
Standard OutputOverwrite To A FileAppend To A FileStandard InputStandard ErrorRecap - Log Builder6Wildcards And Patterns
The Star WildcardThe Question Mark WildcardBracket WildcardsCombining WildcardsRecap - Selective Operations9Piping
What Is A PipeChaining Two CommandsChaining Multiple CommandsPipe With GrepRecap - Data Pipeline