Hi,
how can i get the IP address associated with a network interface using the terminal?
Javi
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Get the IP address associated with a network interface
-
- Posts: 6
- Joined: 2008-11-02 16:00
Re: Get the IP address associated with a network interface
With ifconfig. For example eth0:
Code: Select all
$ /sbin/ifconfig eth0
Q: Why is the Eunux kernel so bloated?
A: It was made in the image of its founder.
A: It was made in the image of its founder.
Re: Get the IP address associated with a network interface
Code: Select all
/sbin/ifconfig -a
Code: Select all
sudo ifconfig -a
Re: Get the IP address associated with a network interface
Or, if you don't feel like reading all that junk:debil wrote:With ifconfig. For example eth0:Code: Select all
$ /sbin/ifconfig eth0
Code: Select all
/sbin/ifconfig wlan0 | grep addr: | awk '{print $2}'
Re: Get the IP address associated with a network interface
Since sudo is not misused by default in Debian, better to doderanjer wrote:Code: Select all
sudo ifconfig -a
Code: Select all
$ su -c "ifconfig -a"
Or if you want to get rid of all that "addr:" junk:dbbolton wrote:Or, if you don't feel like reading all that junk:Code: Select all
/sbin/ifconfig wlan0 | grep addr: | awk '{print $2}'
Code: Select all
$ /sbin/ifconfig eth0 | grep addr: | cut -d: -f2 | cut -d" " -f1
Q: Why is the Eunux kernel so bloated?
A: It was made in the image of its founder.
A: It was made in the image of its founder.
Re: Get the IP address associated with a network interface
dbbolton:
debil:
i like both. finally a reason to make use of an alias (and... done). thanks
Code: Select all
/sbin/ifconfig wlan0 | grep addr: | awk '{print $2}'
Code: Select all
$ /sbin/ifconfig eth0 | grep addr: | cut -d: -f2 | cut -d" " -f1
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.