LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   the pipe operator (https://www.linuxquestions.org/questions/linux-newbie-8/the-pipe-operator-468401/)

AmphetaminePhreak 07-27-2006 09:43 PM

the pipe operator
 
what does | do in the console, as in |grep? i can't find any documentation on it.

as987 07-27-2006 10:00 PM

Briefly, it allows you to feed the output (stdout) of one process (the left side of the pipe in your case) to the input (stdin) of another process (the right side of the pipe - i.e. grep in your case).

Unix Pipe on Wikipedia

Matir 07-27-2006 10:00 PM

It connects the standard output of the preceeding command to the standard input of the following command.

konsolebox 07-27-2006 10:01 PM

that simply redirects the output of the first command as input to the second command.

Code:

sendoutput | acceptasinput
for documentations, do
Code:

man bash
look for the redirection section.

myates1980 07-28-2006 08:39 PM

I think the best way to learn is by doing.

Type: ps ax
hit ENTER
a list of processes will scroll past
now type: ps ax | more
and the same list will scroll by but it will pause before running off the screen. This is because you "piped" the output of the command ps ax to more. The pipe operator is the most useful in linux...learn to use it well and you will have an easy time of using linux.


All times are GMT -5. The time now is 08:12 PM.