Re: fgrep,grep and egrep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/08/2010 10:54 AM, Kevin J. Cummings wrote:
> On 06/08/2010 12:40 PM, Kaushal Shriyan wrote:
>    
>> Hi,
>>
>> can someone explain me about the usage of grep , fgrep and egrep
>> with examples.
>> In what contexts i should use which.
>>      
> The grep man page explains it well enough:
>    
...

All well and good, but:

Once upon a time  ...

fgrep used to equate to fast grep, or file grep -- both start with f so 
it was easy to remember.

Want to get a subset of two lists?

fgrep -f file1 file2

will produce a subset existing in file2 from file1.


Want to search for more than one string, or using a complex regular 
expression?

egrep "this|that|the other" file1

That was the difference, and for us old guys, they still work that way, 
even though there is really only one grep program.  How you envoke it 
sets it to default to the other behavior, or the command line switch 
does the same, as explained.

For new guys, learn to use grep always, but us old guys are glad the 
links to the old versions are still there. :)
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux