ifconfig shows too much information. I need to know all net interfaces no matter whether they are available or not and pair them with their ip addresses and masks.
In case if ficonfig returns
enp9s0 Link encap:Ethernet HWaddr 54:be:f7:5c:99:0d
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:18
lo Link encap:Локальная петля (Loopback)
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:256 errors:0 dropped:0 overruns:0 frame:0
TX packets:256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19992 (19.9 KB) TX bytes:19992 (19.9 KB)
wlp8s0 Link encap:Ethernet HWaddr f8:2f:a8:f3:1b:31
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::820d:4dd0:b3f9:10ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:241 errors:0 dropped:0 overruns:0 frame:4220
TX packets:301 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:101434 (101.4 KB) TX bytes:101132 (101.1 KB)
Interrupt:17
Example output:
enp9s0: addr:- Mask:-
lo: addr:127.0.0.1 Mask:255.0.0.0
wlp8s0: addr:192.168.0.102 Mask:255.255.255.0
Output:
Btw: With Ubuntu,
ifconfig
is deprecated and replaced by iproute2.