Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it correct to say that the only difference between the 'input redirection operator' and the 'pipeline operator', is that '<' redirects standard input from a file, and '|' redirects input TO a program?

share|improve this question
up vote 2 down vote accepted

Both set the standard input to a command. The difference is that the pipe operator connects one command's standard output to another command's standard input, and the file redirection operator connects a file to a command's standard input.

There is also the use of an anonymous pipe to connect the programs when using the pipe operator, which is not required when redirecting from a file. Another thing to bear in mind is that the pipe operator creates a subshell, whereas IO redirection does not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.