I am trying to list network interface that I am currently using. I need to know how to do this in terminal, and in script.
ifconfig | grep $(networksetup -listnetworkserviceorder | grep 'Ethernet, Device' | sed -E "s/.*(en[0-9]).*/\1/")
What am i getting: enter image description here
What do I want to get: Only the name of active interface