LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 09: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, 10: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, 10:00 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
It connects the standard output of the preceeding command to the standard input of the following command.
 
Old 07-27-2006, 10: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, 08: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



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 01:06 AM
operator== for struct lordofring Programming 10 11-21-2005 12:09 PM
C++ operator += uman Programming 1 02-20-2005 04:37 PM
operator precedence in C Majjj Programming 2 07-07-2004 11:48 AM
~ operator linuxanswer Programming 7 04-08-2004 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:17 PM.

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
Open Source Consulting | Domain Registration