You're viewing a comment by waldner and its responses.

waldner Permalink
September 12, 2009, 20:37

The shortest solution using ip and awk:

ip a|awk '/ne/&&$0=$2'

Even shorter:

ip a|awk '/g/&&$0=$2'

These all fail miserably if you have "ne", "net" or "inet" in an interface's name, which is perfectly possible.

But back to ifconfig,

ifconfig|awk -F' |:' '/sk/&&$0=$13'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "rocket_90": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.