See the last few lines of post #16
Note that this thread is more that a year old. Often posting to an old thread will result in no answers because nobody will look at thread that old. You'll have better luck if you start a new thread with your question.
Since you seem new to Linux, I recommend that you look in the tutorials section
for general information about Linux Questions and other topics.
As a general answer, almost every command reads its input from the "standard input device," /dev/stdin, and sends its output to the "standard output device," /dev/stdout. (Any error messages are sent to the "standard error device," /dev/stderr.)
When you're using a terminal, you're "actually" running a program called the "shell" program. Almost always, that is a program called bash
, although there are several other shell programs in common use. bash
, and most of the other shell programs, use redirection operators (< << <<< > >>
) to change the default to some other file. (The < operators change the input, the > ones the output.)
For example the command echo "Hello World!"
would display Hello World on your terminal; echo "Hello World!" > example
would create (or overwrite) a file called "example" (in your "current directory") containing that line. The cat
command will copy a file (or a set of files) to the standard output.
Here's an example:
$ echo "Hello World"
$ echo "Hello World" > example
$ cat example
$ cat example example
$ rm example
command, at the end, removes the "example" file.)