I know there is ifconfig command that we can list network interface info.
but i want to get information in the following pattern
Interface_Name IP_Address Net_Mask Status(up/down)
for example
eth0 192.168.1.1 255.255.255.0 down
I tried ifconfig and grep command but can't get right pattern.
There is another command or some trick to do this?
Best Solution
Python is good :D but let see in bash:
It is quite straightforward.
This is done on an assumption that '
ifconfig interface
does not show an internet address' to means that the interface is down.I hope this helps.