TL/DR: ifconfig
is now ip a
. Try ip -s -c -h a
.
Your path looks OK, but does not include /sbin
, which may be intended.
You were probably looking for the command /sbin/ifconfig
.
If this file does not exist (try ls /sbin/ifconfig
), the command may just be not installed.
It is part of the package net-tools
,
which is not installed by default, because it's deprecated
and superseded by the command
ip
from the package iproute2
.
The function of ifconfig
without options is replaced by ip
specifying the object address
.
ifconfig
is equivalent to
ip addr show
and, because the object argument can be abbreviated and command defaults to show
, also to
ip a
The output format is somewhat different:
$ ifconfig
lo Link encap:Local 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:10553 errors:0 dropped:0 overruns:0 frame:0
TX packets:10553 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9258474 (9.2 MB) TX bytes:9258474 (9.2 MB)
[ ... ]
and
$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
[ ... ]
Note the output is more terse:
It does not show counts of packets handled in normal or other ways.
For that, add the option -s
(-stats
, -statistics
):
$ ip -s addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
RX: bytes packets errors dropped overrun mcast
74423 703 0 0 0 0
TX: bytes packets errors dropped carrier collsns
74423 703 0 0 0 0
But what you actually want to see may be this:
$ ip -stats -color -human addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
RX: bytes packets errors dropped overrun mcast
74.3k 700 0 0 0 0
TX: bytes packets errors dropped carrier collsns
74.3k 700 0 0 0 0
It shows counts with suffixes like 26.1M
or 79.3k
and colors some relevant terms and addresses.
If you feel the command is too long, use the short options:
This is equivalent:
ip -s -c -h a
sudo /sbin/ifconfig
. – Ramesh Jul 19 '14 at 11:34/sbin/ifconfig
? Looking at my system, I can't find an/sbin/config
either. BTW, what do you get fromls /sbin/ifconfig
? – celtschk Jul 19 '14 at 11:35ip
. – vinc17 Jul 19 '14 at 11:41locate ifconfig
says – klerk Jul 19 '14 at 11:43ip
command. ifconfig is deprecated now – SHW Jul 19 '14 at 11:47sudo
:/sbin/ifconfig
is enough if you want to see settings. You only needsudo
if you want to change settings (and thensudo ifconfig
is enough). – Gilles 'SO- stop being evil' Jul 19 '14 at 12:01ip
tool has decided thatifconfig
was deprecated doesn't mean that the rest of the world has to stop using it. – Gilles 'SO- stop being evil' Jul 19 '14 at 12:02ifconfig
. Anyway, thanks for enlightening :) – SHW Jul 21 '14 at 05:54