0

Below is the machine:

$ uname -a
Darwin whatever 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64
$

In ubuntu, ip addr or ip a gives list of all interfaces.

What is the similar command in mac?

1

networksetup -listallnetworkservices is the macOS command that I believe you are looking for.

Quoting from man networksetup:

-listallnetworkservices

Displays a list of all the network services on the server's hardware ports. An asterisk (*) denotes that a network service is disabled.

On my MacBook Air:

An asterisk (*) denotes that a network service is disabled.
Wi-Fi
iPhone USB
Bluetooth PAN
Thunderbolt Bridge

There's also ifconfig which will show you IP addresses and MAC addresses, if that is what you are looking for.

|improve this answer|||||
  • The correct answer to the question is ifconfig -a as it will list all interfaces; both physical and logical (virtual). Less correct is networksetup -listallhardwareports which will list all of the physical interfaces and the least correct is networksetup -listallnetworkservices which only lists the services available. Also ifconfig does much, much more than show IP and MAC addresses. – Allan Jan 12 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .