LinuxQuestions.org
Register a domain and help support LQ
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-24-2003, 12:46 AM   #1
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 636

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-24-2003, 12:52 AM   #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-24-2003, 12:56 AM   #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-24-2003, 12:57 AM   #4
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
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-24-2003, 12:58 AM   #5
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

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

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, 01:07 AM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Well, install Cygwin!
 
Old 07-24-2003, 01: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, 03:04 AM   #9
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 636

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


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