LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2003, 11:46 PM   #1
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637

Rep: Reputation: 32
Question What is grep?


I just got through with a job interveiw that has a lot of unix to it... one of the things that came up was the command grep...

They were doing something on te command line like: ... | grep....

Anyone?
 
Old 07-23-2003, 11:52 PM   #2
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
http://www.computerhope.com/unix/ugrep.htm#01
 
Old 07-23-2003, 11:56 PM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Y'know you can literally type 'whatis grep' into a prompt and get an answer?

Code:
|--digiot@slackath Wed Jul 23 20:56:10
|--bash 2.05b ~ $ whatis grep
grep                 (1)  - print lines matching a pattern
 
Old 07-23-2003, 11:57 PM   #4
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
did you look at the man page?
man grep
so for example if i wanna use grep to search through my rpm database to see if i have xine installed i can use:
rpm -qa |grep xine
and this will only output from my whole rpm database any words that contain xine.
so my results are:
xine-0.9.20-fr1
xine-skins-1.5-fr1
xine-lib-1.0.0-fr0.beta9.1
if i would just type a simple rpm -qa i would get a huge list of everything and instead of searching through that list manually, i let grep do the work
 
Old 07-23-2003, 11:58 PM   #5
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
man i'm slow hehe, there was no responses when i started typing
 
Old 07-24-2003, 12:02 AM   #6
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637

Original Poster
Rep: Reputation: 32
Quote:
Originally posted by digiot
Y'know you can literally type 'whatis grep' into a prompt and get an answer?

Code:
|--digiot@slackath Wed Jul 23 20:56:10
|--bash 2.05b ~ $ whatis grep
grep                 (1)  - print lines matching a pattern

I'm at work on my Windows box dogg.... no go for now
 
Old 07-24-2003, 12:07 AM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Well, install Cygwin!
 
Old 07-24-2003, 12:09 AM   #8
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
if you are on windows box read the second post
 
Old 07-24-2003, 02:04 AM   #9
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637

Original Poster
Rep: Reputation: 32
Quote:
Originally posted by Jatt_thugz
if you are on windows box read the second post
perfect! thx man
 
  


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
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 12:22 PM
help on grep!!!! sanjith11 Programming 5 01-20-2005 05:43 PM
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display? davidas Linux - Newbie 2 03-18-2004 01:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

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

All times are GMT -5. The time now is 05:32 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