Text-only | Table of Contents (frame/ no frame) |
(9) Redirection and Pipes |
![]() ![]() ![]() |
>
- Takes the output of a command/program and send it to a file,
ls -la > list_file
<
- Directs a file to standard input, mail unix10 < list_file
>>
- Will append to a file,
note that >
will overwrite a file
|
takes the output (stdout) of one command and makes
it the standard input (stdin) of another command, connects commands together
ls -la | mail joe.the.smith@dartmouth.edu
will take the output of the
ls
command and "pipe" it into the mail
command;
cat /etc/passwd | wc
will send all the lines of the password file to wc (word count)
tee
- Displays input and writes it out to a file,
good for verifying arguments; find /usr -name README -print | tee to_read
slide09.src last modified Feb 8, 2011 | Introduction | Table of Contents (frame/no frame) |
Printable (single file) |
© Dartmouth College |