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 ...

Get Mac OS X 10.4 Tiger: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.