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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux