Personal tools
You are here: Home Members pacneil's Home Beginning Linux Redirection
Navigation
Log in


Forgot your password?
New user?
 
Document Actions

Redirection

by Neil Schneider last modified 2005-06-08 12:47

Redirection

next up previous contents index
Next: Connecting with Pipes Up: Shortcuts Previous: Filename Expansion

Redirection

Redirection allows you to take the ouput from a command and redirect it to a file. This allows you to capture If we wanted to capture the output of the ``ls man?''command we could redirect it to a file.

# ls man? > manfiles.list

# ls

man1/ man4/ man7/ manfiles.list whatis

man2/ man5/ man8/ manl/

man3/ man6/ man9/ mann/
If the file manfiles.list doesn't exist, it will be created. If there is a file manfiles.list it will be overwritten. It is also possible to redirect the input. We could mail the file we just created by redirecting the standard input of the mail command like this.

$ mail <manfiles.list
Suppose we want to append a list from another man directory /usr/local/man/ to this list. We would use the append ``>>'' redirection to add them to the manfiles.list like this.

# cd /usr/local/man

ls man? >> /usr/man/manfiles.list




2005-05-10

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: