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

SOLVED: Retrieve name of the active network interface only

How can I retrieve from the command line or bash(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).

SOLVED: Retrieve name of the active network interface only

How can I retrieve from command line or bash script only the name of the active network interface?

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).

Solved with an non deprecated solution (ip and not ifconfig)!
Source Link
aurelien
  • 2.4k
  • 1
  • 14
  • 25

SOLVED: Retrieve name of the active network interface only

How can I retrieve from command line or bash script only the name of the active network interface?

This question is not duplicated, the good response of @terdon : ip addr show | awk '/inet.*brd/{print $NF; exit}'

Demonstrate that my question was different and the result precise!

Retrieve name of the active network interface only

How can I retrieve from command line or bash script only the name of the active network interface?

This question is not duplicated, the good response of @terdon : ip addr show | awk '/inet.*brd/{print $NF; exit}'

Demonstrate that my question was different and the result precise!

SOLVED: Retrieve name of the active network interface only

How can I retrieve from command line or bash script only the name of the active network interface?

Post Closed as "Duplicate" by jasonwryan, Chris Davies, cas, mdpc, Wildcard
demonstrate that my question was not duplicate
Source Link
aurelien
  • 2.4k
  • 1
  • 14
  • 25

How can I retrieve from command line or bash script only the name of the active network interface?

This question is not duplicated, the good response of @terdon : ip addr show | awk '/inet.*brd/{print $NF; exit}'

Demonstrate that my question was different and the result precise!

How can I retrieve from command line or bash script only the name of the active network interface?

How can I retrieve from command line or bash script only the name of the active network interface?

This question is not duplicated, the good response of @terdon : ip addr show | awk '/inet.*brd/{print $NF; exit}'

Demonstrate that my question was different and the result precise!

Source Link
aurelien
  • 2.4k
  • 1
  • 14
  • 25
Loading