I want the default interface name. How do I do this without perl?
ip route show to default | perl -pe's/^default via [0-9.]+ dev ([0-9a-z]+).*/$1/'
Is this working with other distributions also? There are names like ens3p0 or something like that.
Try this command:
Information:
grep -Eo "dev\s*[[:alnum:]]+"
: Get the device name after the ord "dev".sed 's/dev\s//g'
: Remove the leading space from the previous output.