Command Line Basics: Pipelining Output

One of the most powerful features of the Linux command line interface, (and other shells that conform to the POSIX standard) is the ability to pipeline output from one command as the input to another. This is done using the vertical bar or pipe character [ | ].

For an example, I’ll show something fairly useless. You probably know that the ls command will list the files in a directory. I’ve also covered the use of the echo command. The output of the command echo ls is simply ls.

echo ls

ls

So if we pipe this output into a new bash shell, we should get the normal output of the ls command.

echo ls | bash

Like I said, this is a fairly simple and useless example, but I’ll show more advanced uses of this in later posts. I’ve also used pipelining in some bash scripts like my script to Batch Watermark Images with ImageMagick.

3 thoughts on “Command Line Basics: Pipelining Output

  1. Pingback: Weapons Guru Football Texting ~ ThermionicEmissions

  2. Pingback: fsdaily.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.