显示当前使用的网络接口

$ ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'

输出结果

1
2
	eth0
	eth1
0%