Using Command Output for Complex Tasks
One of the greatest advantages of the Linux command line is that it enables you to tie multiple commands and their output together in a wide variety of ways. By tying commands, you can perform complex tasks that involve multiple steps; the output can be further refined at each step, to fulfill your needs in the most unusual of situations.
The two most important techniques for tying multiple commands are the use of pipes—which enable the output of one command to act as the input for another command—and command substitution—which enables the output of one command to alter the behavior of another command.
Using Pipes to Link Commands
Sometimes it is convenient to use the output of one command as the input of ...