Skip to main content
4 of 4
Deleted invalid label from title; added clarifying information from comments; improved tags.

Retrieve name of the active network interface only

How can I retrieve from the command line (or a shell script) only the name of the active network interface, in Linux? If there are several active interfaces, I want just one (selected arbitrarily).

aurelien
  • 2.4k
  • 1
  • 14
  • 25