Using Files Instead of the Terminal
When you run a program, the program usually produces some output which
appears on your terminal screen. If you wish, you can redirect the
output into a file. For example, the "who" command will produce output
like this:
operator console Sep 3 05:59
eauu016 ttyp4 Sep 4 14:07 (csi-ts3.nts.uci.)
eaacct ttype Sep 3 15:25 (csi-ts3.nts.uci.)
nest ttypf Sep 4 08:18 (ghostbusters.nts)
eapu163 ttyq2 Sep 4 10:47 (csi-ts3.nts.uci.)
operator ttyq3 Sep 3 15:57 (csi-ts3.nts.uci.)
You can redirect the output from "who" into a file by typing:
This command will create a new file called 'who_file' that contains the
output from the "who" command. If you already had a file called
'who_file', its contents would be replaced by the output from "who". If
you wish to append to an existing file, you can use two "greater than"
signs:
Click here to go to the next section.
Or click here to go to the
top of the chapter.