Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Check Ip In Linux

DZone's Guide to

Check Ip In Linux

·
Free Resource

#!/usr/bin/perl -w
my @ifconfig = `/sbin/ifconfig eth0`;
for( @ifconfig )
{
	if( /(\d+\.\d+\.\d+\.\d+)/ )
	{
		print "IP : $1\n";
		last;
	}
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}