H I O X INDIA
LINUX Commands
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

LINUX / UNIX cmd
Introduction
Commands in A
Commands in B
Commands in C
Commands in D
Commands in E
Commands in F
Commands in G
Commands in H
Commands in I
Commands in J
Commands in K
Commands in L
Commands in M
Commands in N
Commands in P
Commands in R
Commands in S
Commands in T
Commands in U
Commands in W
Commands in Y
More about Linux
Feedback




egrep Linux Commands


Topic

What is Linux egrep Command?




Explanation

egrep COMMAND:
     egrep command is used to search and find one or more files for lines that match the given string or word.

SYNTAX:
  The Syntax is
     egrep [options] pattern [file]

OPTIONS:
     
-b Print the byte offset of input file before each line of output.
-c Print's the count of line matched.
-e  pattern list Searches the pattern list.
-h Print matched lines but not filenames.
-i Ignore changes in case; consider upper- and lower-case letters equivalent.
-n Print line and line number.
-q Prints in quite mode, prints nothing.
-r Recursively read all files in directories and in subdirectories found.
-v Prints all the lines that do not match.
-V Print Version.
-w Match on whole word only.
You can also use Patterns for search operation.
. Matches single character.
* Wild Character.
^ Starting with.
$ Ending with.



EXAMPLE:
      Lets assume that we have a file file1.txt and it has the following data.
hscripts has many valuable free scripts
It is the parent site of www.forums.hscripts.com
hscripts include free tutorials and free gif images
free DNS lookup tool
Purchase scripts from us
A webmaster/web master resource website
  1. To search more words from a file :
    egrep 'hscripts|forums|free' file1.txt
    The output will be.
    hscripts has many valuable free scripts
    It is the parent site of www.forums.hscripts.com
    hscripts include free tutorials and free gif images
    free DNS lookup tool

  2. To print the lines containing "free" followed by images:
    egrep 'free.*images' file1.txt
    The output will be.
    hscripts include free tutorials and free gif images





        Find LINUX Commands... Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this LINUX / UNIX cmd reference. This is a copyright content.


privacy policy     license     sitemap
© 2004-2009 HIOX INDIA - hioxindia.com

Other Links