• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

Understanding GREP

What is GREP?
What does the acronym stand for?
What is an example of how it is used?
0
yip459
Asked:
yip459
  • 2
  • 2
  • 2
  • +1
5 Solutions
 
Darr247Commented:
Global Regular Expression Parser answers 1 and 2.

rpm -qa | grep -i vga
That example queries all rpm packages installed on a redhat package manager system (like RedHat, fedora, CentOS) and pipes the results to grep, which filters the output down to packages with the sequence "vga" in the title. The -i switch makes grep case-insensitive, so "vga" would match, as would VGA, Vga, vgA, WavGain, etc.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Or if you want to find something in a file:

grep -i something /path/to/somefile
0
 
Darr247Commented:
For any linux command, you should be able to run
$ man [command]
and get a help manual for that command.
e.g.
$ man grep
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ozoCommented:
Its name comes from the ed command g/re/p (global / regular expression / print
0
 
burrcmCommented:
So in summary, find a (G)lobally (R)epeating (E)xpression and (P)rint it, meaning display anything which contains the search string entered.

Chris B
0
 
ozoCommented:
regular expression, (http://en.wikipedia.org/wiki/Regular_expression#Formal_definition)
not (R)epeating (E)xpression
0
 
burrcmCommented:
True. Missed by that much...

Chris B
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now