- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to grep for exact word
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 07:44 PM
тАО09-22-2002 07:44 PM
how to grep for exact word
i would like to find out if it is possible to use grep to search for exact word in a file.
eg. if i use grep ab filename, it will display ab, abc, abcd, etc. but i only want to search for just ab.
Any advice ? Thanks in advance.
Best Regards,
Irman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 07:54 PM
тАО09-22-2002 07:54 PM
Re: how to grep for exact word
kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 08:14 PM
тАО09-22-2002 08:14 PM
Re: how to grep for exact word
try this
grep -E -l word
bye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 09:04 PM
тАО09-22-2002 09:04 PM
Re: how to grep for exact word
Try grep -x "word" filename
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 09:15 PM
тАО09-22-2002 09:15 PM
Re: how to grep for exact word
tried all the advice but not working. however, i fixed my problem my adding a space behind the word i am searching for, ie. grep "ab " filename.
thanks for the reply.
best regards,
irman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2002 10:25 PM
тАО09-22-2002 10:25 PM
Re: how to grep for exact word
egrep "(^|[^a-zA-Z0-9])WORD($|[^a-zA-Z0-9])"
The reverted character class [^.....] should hold all possible character for your WORD. If you use other program (like perl) instead of the unox grep command, there may be abbrevations for this string.
Heiner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2002 05:15 PM
тАО09-23-2002 05:15 PM
Re: how to grep for exact word
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2002 05:15 PM
тАО09-23-2002 05:15 PM