Is there a way in terminal to list all interfaces of a certain type? For example, In System Information under the Network category i can see a Type column which has values of AirPort, Ethernet, and PPP (PPPSerial). I'd like to be able to list out everything of type "Ethernet"
Solved
List all Ethernet Interfaces
Best answer by Samuarl
#/bin/sh
networksetup -listallnetworkservices | while read service;
do
networksetup -getinfo "$service" | grep 'Ethernet Address' > /dev/null
if [ $? -eq 0 ]
then
echo "$service"
fi
done
This will show all network services which have an 'Ethernet Address' property. Surprisingly Bluetooth shows as an Ethernet type link. If you want to exclude it you can just add another ```
grep -v 'Bluetooth'and for only active interfaces add
grep -v 'null'
```
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
