Pipe: Difference between revisions
From Hackepedia
Jump to navigationJump to search
No edit summary |
I don't think this image helps anyone conceptualize the concept.. |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
If you need to send the output of one program to another program this is done by way of piping. For example you are listing the directory of your current working directory and want to see it in chunks called pages, you'll pipe the output of [[ls]] to [[more]] like so: | If you need to send the output of one program to another program this is done by way of piping. For example you are listing the directory of your current working directory and want to see it in chunks called pages, you'll pipe the output of [[ls]] to [[more]] like so: | ||
$ ls | more | $ ls | more | ||
when you create along chain of piped commands this is called a pipeline and can look like this: | when you create along chain of piped commands this is called a pipeline and can look like this (do not run this unless you need to kill your webserver via brute force method): | ||
$ ps ax | grep httpd | awk '{print $1}' | xargs kill | $ ps ax | grep httpd | awk '{print $1}' | xargs kill |
Latest revision as of 12:32, 25 October 2005
If you need to send the output of one program to another program this is done by way of piping. For example you are listing the directory of your current working directory and want to see it in chunks called pages, you'll pipe the output of ls to more like so:
$ ls | more
when you create along chain of piped commands this is called a pipeline and can look like this (do not run this unless you need to kill your webserver via brute force method):
$ ps ax | grep httpd | awk '{print $1}' | xargs kill