LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-30-2006, 03:44 PM   #1
lonecrow
Member
 
Registered: May 2005
Location: Canada
Distribution: PCLinuxOS 2007
Posts: 274

Rep: Reputation: 30
what does | mean?


does it mean to continue the command or?

Like this exemple,
Code:
bunzip2 filename | tar -xvf -
I understand the command, but still I can't figure out what | is doing there. Ive seen it often used with the grep command as well.

Sorry since it's probably a repost, but it's hard to make a search using only "|"


Thanks very much for your help!
 
Old 03-30-2006, 03:46 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
the pipe means that the output of the first program is used as the input to the second.
 
Old 03-30-2006, 04:26 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,452
Blog Entries: 4

Rep: Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915
This is what Unix-heads call a "pipe."

I would strongly invite you to surf (here and elsewhere) for a general introduction to the bash shell. I won't try to substitute for that here.

However, to answer the immediate question ...

Consider the following:
Code:
 ps -A | grep mysql
...
  • The shell will start both the ps command and the grep command.
  • The shell will "pipe" the output from the first command so that it becomes the input to the second.
  • The shell will wait for the two commands to end.
 
Old 03-30-2006, 04:49 PM   #4
lonecrow
Member
 
Registered: May 2005
Location: Canada
Distribution: PCLinuxOS 2007
Posts: 274

Original Poster
Rep: Reputation: 30
I am actually reading on that, hence the point of my question!
Thanks to both of you!
 
  


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



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

All times are GMT -5. The time now is 03:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration