Output Redirection
In all of the Unix commands up to this point that produced output—such as man and ls—the command output appears in the Terminal window. This is called the standard output device of Unix.
But the shell can also redirect the output of a command to a file instead of to the screen. This output redirection enables you to create files by writing command output to a file.
Output redirection uses the greater-than character (>) to tell the shell to place the output of a command into a file rather than listing it to the screen. If the output file already exists, it is overwritten with the new information.
Similarly, a pair of greater-than signs (>>) tells the shell to append the output of a command to the end of a file rather than erasing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access