What is the difference between "Redirection" and "Pipe"?

Posted by John Threepwood on Ask Ubuntu See other posts from Ask Ubuntu or by John Threepwood
Published on 2012-08-07T13:22:19Z Indexed on 2014/08/23 22:35 UTC
Read the original article Hit count: 244

Filed under:
|

This question may sound a bit stupid, but I can not really see the difference between redirection and pipes.

Redirection is used to redirect the stdout/stdin/stderr, e.g. ls > log.txt.

Pipes are used to give the output of a command as input to another command, e.g. ls | grep file.txt.

But why are there two operators for the same thing ?

Why not just write ls > grep to pass the output through, isn't this just a kind of redirection also ? What I am missing ?

© Ask Ubuntu or respective owner

Related posts about pipe

Related posts about redirect