Home > Linux, Tech > Named Pipes in a *nix shell

Named Pipes in a *nix shell

November 11, 2013 Leave a comment Go to comments

Most of those familiar with *nix are familiar with piping data “|” to other programs. At the very least, you probably have piped the result of many commands into grep (ls | grep x).

But did you know you can pipe output into a named pipe in a terminal/shell?

This article is from 1997, but this information on using named pipes certainly hasn’t expired:

The simplest way to show how named pipes work is with an example. Suppose we’ve created pipe as shown above. In one virtual console1, type:

ls -l > pipe1

and in another type:

cat < pipe

Voila! The output of the command run on the first console shows up on the second console. Note that the order in which you run the commands doesn’t matter.

Advertisements
Categories: Linux, Tech
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s