stdin

From NetBSD Wiki

Jump to: navigation, search

stdin is the first filedescriptor. It has the number 0. For more information, see File descriptors. Most tools will read their input data from stdin by default.

Common usage patterns

Pagers like more or less are most useful when reading from stdin:

$ ls -C | less

will redirect the output of a columned ls output to less, so one can leisurely browse through its output. By default, ls will change from a columned output to one entry per line if its output is not to a terminal, that's why we add the -C flag.

See also

Retrieved from "http://wiki.netbsd.se/stdin"
Personal tools