qbbr.io / blog

Source: markdown
$ ip -o -4 addr list eth0 | awk '{ print $4 }'

or

$ /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'

for ipv6:

ip -o -6 addr list eth0 | awk '{ print $4 }' | head -n 1 | cut -d '/' -f 1

where eth0 - interface

comments powered by Disqus
On your computer does not found Web Browser!
Plz install it.
Firefox
Chromium
Google Chrome
Safari
Opera