Computing.Net > Forums > Linux > Grep for IP Addresses

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Grep for IP Addresses

Reply to Message Icon

Name: whitehat5437
Date: January 8, 2003 at 05:49:14 Pacific
OS: Linux
CPU/Ram: PIII/512
Comment:

I need to search a HDD and locate all the IP addresses. Normally I just look for on IP, which is this command

find / -type f | exec grep -il "ip.add.re.ss" {} \;

However I have no clue how to search the entire drive and recover only valid IPs.




Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: January 8, 2003 at 09:32:07 Pacific
Reply:

Try:

# grep '[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*' /* -R

NB all on one line


0

Response Number 2
Name: crypto76
Date: January 12, 2003 at 09:09:11 Pacific
Reply:

look in /etc/sysconfig/network-scripts/

ifcfg-eth0 and so on.

if you have virtuals, they'll be in there as well.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


how to install oracle on ... erasing tape contents



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Grep for IP Addresses

Get dynamic ip address to use for a fire www.computing.net/answers/linux/get-dynamic-ip-address-to-use-for-a-fire/4725.html

Finding ip address in Linux www.computing.net/answers/linux/finding-ip-address-in-linux/6541.html

Checking IP Address www.computing.net/answers/linux/checking-ip-address/1167.html