如何快速获取ip和mac地址

快速获取ip地址

ifconfig
ifconfig eth0 | awk NR==2 | awk '{print $2}'

快速获取mac地址

ifconfig
ifconfig eth0 | awk NR==4 | awk '{print $4}'

(说明:NR和FNR 在此处作

猜你喜欢

转载自blog.csdn.net/Lcongming/article/details/121910172
今日推荐