next up previous contents
Next: which Up: Helpful Unix Commands Previous: pwd   Contents

``pipe'' and ``redirection''

$ \vert$, $ >$, $ >$$ >$

These redirect output. The single right arrow redirects from standard output to a new file. The double right arrow appends the standard output to a file. The pipe takes standard output and uses it as the argument to a command.

lightning:~>ls | grep explorer.exe

This would redirect the output from the ls command and use it as the argument to the grep command. It would return any line, in this case file, that contains the string explorer.exe.

lightning:~>ls >> dir_file

Here the output of ls would be put at the end of a file named dir_file

lightning:~>ls > dir_file

This would redirect the output of ls and put it in the new file named dir_file. Note that this will overwrite the file if it already exists.



Computer Support Group 2002-10-07