Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







grep command tips

Expert Oracle Tips by Burleson Consulting

March 22, 2011

grep command tips

Sometimes only specific lines of a file with certain text on it need to be seen.  The grep command examines a file and only display lines that contain a certain string.

$ grep gcc required_packages.txt  


This example displays all the lines in the required_packages.txt file which contain the string gcc.  In this usage, grep matches the string gcc in only its given lowercase form. To search for a string without case sensitivity, add the -i option.

Occasionally, you may want to reverse this search and look for lines which do not contain a given piece of text.  In that case, use the -v option for grep.

$ grep -v -i rpm required_packages.txt
Refer to Note 880211.1 


In this example, the two options -v and -i have been combined to search without case sensitivity for lines that do not contain the string rpm.  When using multiple options, most Linux commands will let you combine them after a single hyphen.  Entering grep -i -v is the same as grep -iv.

These are the most common ways file contents may be viewed.  In the next chapter, how to edit files with the popular, though often maligned, vi editor will be shown.



Get the Complete Details on
Linux System Management for Oracle DBAs  

The landmark book "Linux for the Oracle DBA: The Definitive Reference" provides comprehensive yet specific knowledge on administering Oracle on Linux.   A must-have reference for every DBA running or planning to run Oracle on a Linux platform.

Buy it for 30% off directly from the publisher.



Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster