Over a million developers have joined DZone.

Check Ip In Linux

·

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}