Redirecting output streams
Normally, when you execute a Unix command, its output goes to your display screen. For example:
yourname@yourcomputer<23>% man date
You can redirect the output stream of any process to somewhere else instead of to your display screen.
To do this, after the name of the command and any
arguments, type the ``greater-than''
>), and then type a name.
A file will be created by this name, and the output of that command
will be placed in that file.
yourname@yourcomputer<24>% date >timestampThis would write the current date and time into a file named
timestamp. We could then display the contents of this file by typing:
yourname@yourcomputer<25>% cat timestamp Sat Jan 28 15:03:08 MST 1995
John Shipman, email@example.com
Last updated: 1996/01/06 21:54:47 UT