Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Redirecting output streams

Tech Computer Center logo

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'' symbol (>), 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.

For example:

      yourname@yourcomputer<24>% date >timestamp
This 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

Next: Redirecting input streams
See also: What is a Unix command?
Previous: What is a command line argument?
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 1996/01/06 21:54:47 UT
QR two-dimensional bar code