Solved

Understanding GREP

Posted on 2013-01-15
7
598 Views
Last Modified: 2013-01-17
What is GREP?
What does the acronym stand for?
What is an example of how it is used?
0
Comment
Question by:yip459
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 44

Assisted Solution

by:Darr247
Darr247 earned 200 total points
ID: 38781631
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
 
LVL 37

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 100 total points
ID: 38781637
Or if you want to find something in a file:

grep -i something /path/to/somefile
0
 
LVL 44

Assisted Solution

by:Darr247
Darr247 earned 200 total points
ID: 38781642
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 84

Assisted Solution

by:ozo
ozo earned 100 total points
ID: 38781650
Its name comes from the ed command g/re/p (global / regular expression / print
0
 
LVL 28

Accepted Solution

by:
burrcm earned 100 total points
ID: 38781671
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
 
LVL 84

Expert Comment

by:ozo
ID: 38786192
regular expression, (http://en.wikipedia.org/wiki/Regular_expression#Formal_definition)
not (R)epeating (E)xpression
0
 
LVL 28

Expert Comment

by:burrcm
ID: 38786253
True. Missed by that much...

Chris B
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question