LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to GREP string? (http://www.linuxquestions.org/questions/linux-general-1/how-to-grep-string-822977/)

tquang 07-29-2010 11:45 PM

How to GREP string?
 
Hi, i have question about grep string.

Today, i checking my error log of Apache. I have look many IP brute scan URL.
So, i collect, export that to ip.txt and i need grep IP with connection >=8

I don't know command to solve that. Example ip.txt
Quote:

101 210.13.73.30
161 58.210.77.98
164 115.168.71.87
164 200.247.215.250
164 61.178.24.100
164 61.235.143.134
165 124.160.192.22
165 188.21.56.198
165 189.39.12.20
165 201.227.239.11
165 202.102.123.102
165 202.103.52.147
165 217.112.166.97
165 218.206.219.130
165 218.69.27.138
165 61.240.233.217
165 62.151.177.226
165 86.64.192.188
165 87.106.144.130
165 89.208.153.2
187 91.193.157.206

ghostdog74 07-30-2010 12:36 AM

Code:

awk '$1>=8{print $2}' file

tquang 07-30-2010 12:51 AM

Thank ghostdog74 very much. I will try it.

Have a good day!


All times are GMT -5. The time now is 07:49 PM.