LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2006, 10:43 PM   #1
AmphetaminePhreak
Member
 
Registered: Jul 2006
Location: kinda transient right now. Utah is Home, staying in Ohio
Distribution: Mandrake 9.1/Windows XP
Posts: 46

Rep: Reputation: 15
the pipe operator


what does | do in the console, as in |grep? i can't find any documentation on it.
 
Old 07-27-2006, 11:00 PM   #2
as987
LQ Newbie
 
Registered: Jun 2006
Location: Kansas City, MO USA
Distribution: Fedora Core 5
Posts: 11

Rep: Reputation: 0
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
 
Old 07-27-2006, 11:00 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 122Reputation: 122
It connects the standard output of the preceeding command to the standard input of the following command.
 
Old 07-27-2006, 11:01 PM   #4
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
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.
 
Old 07-28-2006, 09:39 PM   #5
myates1980
Member
 
Registered: Jul 2006
Location: Lancaster, PA
Distribution: Slackware, FreeBSD,
Posts: 43

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with operator new bianchi Programming 6 02-27-2006 02:06 AM
operator== for struct lordofring Programming 10 11-21-2005 01:09 PM
C++ operator += uman Programming 1 02-20-2005 05:37 PM
operator precedence in C Majjj Programming 2 07-07-2004 12:48 PM
~ operator linuxanswer Programming 7 04-08-2004 05:56 PM


All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration