Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 606
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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