Printer Friendly
The Free Dictionary
1,074,609,672 visitors served.
?
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

input/output redirection

    0.12 sec.
(operating system)input/output redirection - In Unix, to send ouput from a process to different file or device or to another process via a pipe, or to have a process read its input from a different file, device or pipe. Some other operating systems have similar facilities.

To redirect input to come from a file instead of the keyboard, use "<":

myprog < myfile

Similarly to redirect output to a file instead of the screen:

ls > filelist

A pipe redirects the output of one process directly into the input of another

who | wc -l

A common misuse by beginners is

cat myfile | myprog

Which is more or less equivalent to "myprog < myfile" except that it introduces an extra unnecessary cat process and buffer space for the pipe. Even the "<" is unnecessary with many standard Unix commands since they accept input file names as command line arguments anyway.

Unix's concept of standard input/output and I/O redirection make it easy to combine simple processes in powerful ways and to use the same commands for different purposes.


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2008 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.. Terms of Use.