Number of interfaces in ifconfig

Joined
Apr 11, 2013
Messages
194
Reaction score
2
Points
18
Your Mac's Specs
13" rMBP 2014, 8GB RAM, 128GB SSD, 2.6GHz i5
How can I find the number of network interfaces which are present on any Mac.

I am writing a script which will be ran on different kinds of Mac, and they will presumebably have a different number of interface connections. When i type "ifconfig | grep ether" then i get 3 interfaces, but how can I get a numerical value for the number of interfaces on a given device?

I will be writing a loop which needs the numerical value of interfaces in ifconfig.

Thanks for all help
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top