![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep ip address | rein | Shell Programming and Scripting | 2 | 05-22-2009 01:25 AM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-05-2007 02:59 AM |
| How to grep dhcp ip address | chongkls77 | Shell Programming and Scripting | 4 | 03-28-2007 09:27 AM |
| How to Achive IP address through MAC(Ethernet) address | krishnacins | IP Networking | 3 | 08-29-2005 08:45 PM |
| network address and broadcast address? | pnxi | UNIX for Dummies Questions & Answers | 7 | 11-10-2003 11:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Code:
egrep -v "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[^54-61]" file
|
|
||||
|
Searching for instance of specific IP in a file
I have a similar question, so I'll post it here.
I have a script that blocks IPs, but checks first to see if the given IP exists in a file before proceeding. In one case, it's /etc/mail/access (Sendmail). The format is generally: 11.22.33 REJECT or SOME MESSAGE Now, say I log an IP of 11.22.3, when I egrep for it, it will also match 11.22.33, which I don't want. So I'm trying to figure out how to limit the egrep search for only that IP - establishing a boundary on the search, which I'm not able to figure out. thanks. Last edited by forrie; 03-06-2009 at 12:23 PM.. Reason: typo |
|
||||
|
Quote:
Code:
egrep "11.22.3 " file |
![]() |
| Bookmarks |
| Tags |
| grep or |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|