GagA// 0n D nEt

It is currently Sun Sep 05, 2010 10:29 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Linux: Get all IPs via ifconfig
PostPosted: Sat Jan 16, 2010 8:07 pm 
Offline

Joined: Wed Jul 18, 2007 1:14 am
Posts: 193
On a server holding multiple interfaces and/or IP addresses, you may find the need to identify the IP addresses being held by the server. Here are a few methods which can be used to identify the same:
Quote:
[root@gagan ~]# ifconfig | perl -nle'/dr:(\S+)/ && print $1'

or
Quote:
[root@gagan ~]# ifconfig | awk '/ddr:[0-9]/ {sub(/addr:/, ""); print $2}'

or
Quote:
[root@gagan ~]# ifconfig | awk -F':| +' '/ddr:/{print $4}'

or
Quote:
[root@gagan ~]# ifconfig | grep "inet addr" | cut -d: -f2 | cut -d' ' -f1


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
GagA// 0n D nEt © 2007, 2008 -- Powered by phpBB