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

I noticed this problem when I became confused with pipe, one command send its executing output to the STDOUT, which is the STDIN for the other command, which can read from STDIN.

How do I know if a Linux command can read from STDIN?

Is there a feature to distinguish commands that can read from STDIN from those cannot?

share|improve this question
I think this is a per-application thing. The best way to know is really just to read the man page or test it yourself. – n0pe Dec 15 '11 at 0:37
This would require solving the halting problem – anonymous coward Dec 21 '11 at 1:03
up vote 5 down vote accepted

(In response to the upvotes on my comment)

There isn't a concrete way of determining if an application reads from STDIN or something else. In general, you'll have to try piping something to it or reading the program's man page.

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.