?
Solved

Understanding GREP

Posted on 2013-01-15
7
Medium Priority
?
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 44

Assisted Solution

by:Darr247
Darr247 earned 800 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 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 400 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 800 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
LVL 84

Assisted Solution

by:ozo
ozo earned 400 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 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 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