Search Results

Search: Posts Made By: satishcarya
6,189
Posted By Scrutinizer
From these I gather that besides ip addresses you...
From these I gather that besides ip addresses you also want to collect IP CIDR ranges. If so, you were close:

egrep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+(/[0-9]+)?' file1

or

grep -Eo...
6,189
Posted By Aia
IP groups for each line: perl -nle...
IP groups for each line:

perl -nle '@ip=/(\d+\.\d+\.\d+\.\d+)/g and print "@ip"' file1
110.20.20.21 10.25.22.21 10.25.22.26
110.24.18.30 10.56.34.33
110.56.22.23 10.56.22.27
110.24.89.60...
6,189
Posted By MadeInGermany
perl -lne 'print if s/.*?(\d+\.\d+\.\d+\.\d+)\D*/...
perl -lne 'print if s/.*?(\d+\.\d+\.\d+\.\d+)\D*/ $1/g' file1Your egrep attempt was close:
egrep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+' file1
6,189
Posted By girijajoshi
grep for /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ...
grep for /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/

cat <filename> |grep (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
6,189
Posted By bakunin
First: tools like grep will not help you because...
First: tools like grep will not help you because they filter certain lines (in which a certain regexp is found) only without modifying them. If you want only the IP addresses alone with no other text...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy