Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


How to grep only IP 10.76.178.xx?


 
Thread Tools Search this Thread
# 1  
How to grep only IP 10.76.178.xx?

hallo, im newbie here Smilie

i have problem when processing some data, i want to get and filter only the IP that start with 10.76.178.xx from both local and peer IP.

here is the data example :
Code:
Local IP=10.68.178.1, Peer IP=10.76.178.37
Local IP=10.68.178.1, Peer IP=10.76.178.37
Local IP=10.68.178.3, Peer IP=10.76.178.38
Local IP=10.68.178.1, Peer IP=10.76.178.38
Local IP=10.68.178.3, Peer IP=10.76.178.38
Local IP=10.68.178.1, Peer IP=10.76.178.38
Local IP=10.76.178.38, Peer IP=10.68.178.3
Local IP=10.76.178.37, Peer IP=10.68.178.1
Local IP=10.76.178.38, Peer IP=10.68.178.3
Local IP=10.76.178.37, Peer IP=10.68.178.1

how to get them ya?
i try use basic
Code:
grep "10.76.178" [filename]

and
Code:
grep -oP "10.76.178" [filename]

can not get what i want.Smilie

result :
Code:
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178

please kindly to help this newbie. Smilie

thank you Smilie
# 2  
grep -o will only output what's matched. To match the other numbers, try:
Code:
$ grep -o 10\.76\.178\.[0-9]* file 
10.76.178.37
10.76.178.37
10.76.178.38
10.76.178.38
10.76.178.38
10.76.178.38
10.76.178.38
10.76.178.37
10.76.178.38
10.76.178.37

This User Gave Thanks to Scott For This Post:
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
HPUX_SCHED_NOAGE 178
ambarginni
We are getting the error below in Linux - Oracle 11g Bench as below: Last System configure: NOTE: Fri May 18 17:34:32 IST 2012: creating SPFILE ... CREATE SPFILE='<path>/ORACLE/admin/eml100_1/pfile/spfile.ora.UPD' FROM PFILE='<path>/ORACLE/admin/eml100_1/pfile/config.ora' * ERROR at line...... UNIX for Advanced & Expert Users
2
UNIX for Advanced & Expert Users

Featured Tech Videos