Linux good old command to check IP Address is ifconfig which works probably in all distro.
There is already new implementation on how to check the IP Address via command line from some distro.
Some distro now supports the command, ip addr show which also displays the IP Address.
The ifconfig command has a long output, which is quite scary if you are new to Linux.
To filter the desired output in ifconfig, awk or gawk will come to the rescue.
Below are some examples on how to do it:
Display only the IP Address:
ifconfig -a | awk 'NR==2'
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
Display only the MAC Address:
ifconfig -a | awk 'NR==1'
eth0 Link encap:Ethernet HWaddr 07:00:16:f1:bb:ac
HWaddr is the MAC Address
Display both IP and MAC Address:
ifconfig -a | awk 'NR==1,NR==2'
Using awk command ifconfig output is displayed line by line.
Some other useful command below to check users login in Linux.
Cheers! Till next time. Enjoy Linux!!!
Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet:
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):