Input redirection in pipes

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
← How to use pipes to connect programsHomeOutput redirection in pipes →
command1 < input.txt | command2
command1 < input.txt | command2 arg1 | command3

For example, the sort command will get input from /etc/passwd file, which is piped to grep command:

sort < input.txt | grep something
sort < input.txt | uniq | grep something
← How to use pipes to connect programsHomeOutput redirection in pipes →