- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- grep for more than 1 value
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-09-2008 02:41 AM
тАО09-09-2008 02:41 AM
I need to grep for more than 1 value and neglect all those lines.
I tried as below:-
cat File_name | grep -v value1
But i can't use grep -v for neglecting more than 1 value.Is there any way to resolve this problem?
Please help me to find out the solution.
Thanks & regards
Muktha
Solved! Go to Solution.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 02:46 AM
тАО09-09-2008 02:46 AM
Re: grep for more than 1 value
Try egrep
# egrep -e value1 -e value2 File_name
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 03:10 AM
тАО09-09-2008 03:10 AM
Re: grep for more than 1 value
cat 1.txt
1
3
5
cat test.txt
1
2
3
4
5
6
7
grep -v -f 1.txt test.txt
2
4
6
7
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 03:14 AM
тАО09-09-2008 03:14 AM
Re: grep for more than 1 value
Thanks for your quick respose.
Regards
Muktha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 03:15 AM
тАО09-09-2008 03:15 AM
Re: grep for more than 1 value
It worked out.
Regards
Muktha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 03:16 AM
тАО09-09-2008 03:16 AM
Re: grep for more than 1 value
You gave new idea..
Regards
Muktha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 03:47 AM
тАО09-09-2008 03:47 AM
Re: grep for more than 1 value
First, don;t add a useless 'cat' to open and read the file, piping that output to 'grep'. That's a wasted process and wasted I/O.
You can do :
# grep -v -e value1 -e value2 -e value3 File_name
(or):
# grep -vE "value1|value2|value3" File_name
Regards!
...JRF...
- Tags:
- evil cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 04:31 AM
тАО09-09-2008 04:31 AM
Re: grep for more than 1 value
Anyway thanks for the guidance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 04:36 AM
тАО09-09-2008 04:36 AM
Re: grep for more than 1 value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2008 12:20 PM
тАО09-10-2008 12:20 PM
Re: grep for more than 1 value
grep -v 'value1
value2
value3' File_name