Solved

Understanding GREP

Posted on 2013-01-15
7
602 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 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 38

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
centos linux 65 192
Why  my code (program) build with old compiler? 11 110
pvcreate issue 5 38
Krita v3 Linux Mint/Ubuntu 16.04 9 20
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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