LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2023, 11:23 AM   #1
eawedat
LQ Newbie
 
Registered: Aug 2012
Posts: 11

Rep: Reputation: Disabled
What is the difference between the option -w and \b with egrep?


Is there difference between:

egrep -w "word" filename
egrep "\bword\b" filename

or both are equal?
 
Old 02-06-2023, 11:33 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,766

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by eawedat View Post
Is there difference between:

egrep -w "word" filename
egrep "\bword\b" filename

or both are equal?
Have you run those commands? Read the man page on egrep? This appears to be another of your homework questions; can you show us your efforts, or explain what you're confused about?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: What’s Difference Between Grep, Egrep and Fgrep in Linux? LXer Syndicated Linux News 0 08-20-2021 01:26 AM
LXer: Explained! The Difference Between grep, egrep, and fgrep Commands LXer Syndicated Linux News 0 07-24-2020 11:00 AM
grep, egrep,pgrep and fgrep difference. Kayalvizhi Linux - General 5 08-19-2018 11:23 AM
What is the difference between grep and egrep command winn Linux - Newbie 3 01-24-2018 06:30 AM
diffrence between grep, sed, awk and egrep Fond_of_Opensource Linux - Newbie 3 08-18-2006 08:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration