T o n g wrote: > Now a related question, how to get *only* the IP address of my > current Intranet address 192.168...? > > Is there easier answers than analysing results from the following? > > ifconfig eth0 > ip addr > ip -f inet addr
Please remember that hosts have devices and devices have addresses. Therefore a host might have many addresses. Here is one way: $ ip addr show | awk '/ inet /{print$2}' Or if you don't like loopback addresses showing up in the list: $ ip addr show | awk '/ inet / && !/127\./{print$2}' Bob
signature.asc
Description: Digital signature