On Sat, 27 May 2006 17:32:53 +0200
Anders Johansson
On Saturday 27 May 2006 17:20, lerninlinux@comcast.net wrote:
How do I pipe the results to the text file? Is that "|" the command?
You don't pipe to a file, you pipe to a command. To a file you "redirect"
To redirect the output to a file you use the > operator, for example
diff -u file1 file2 > outputfile
Just as a general point of information. Many of the Linux/Unix command line utilities were designed to be simple commands receiving input from the standard input, and output to standard output and errors to standard error. As Anders mentions, you can redirect to a text file, or pipe it into a utility. In general, the redirect operators are:
-- Redirect standard output to a file.
-- Append standard output to a file < - Redirect standard input from a file | - pipe the output to another program.
There are ways of redirecting standard error also, but they are a bit
shell-centric and will be different on C-Shell derivatives and Bourne
Shell derivatives.
--
Jerry Feldman