zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Linux-练习-取IP详解程序员

LinuxIP程序员 详解 练习
2023-06-13 09:19:57 时间

1.grep :ifconfig eth0 | grep -o ^[^6]* addr:[0-9.]* | grep -o [0-9.]*

2.sed :ifconfig eth0 | sed -nr s#^.*dr:(.*)  B.*$#/1#g p

3.sed :ifconfig eth0 | sed -nr /^.*dr:(.*)  B.*/s##/1# p

4:awk :ifconfig eth0 | awk -F [ :]+ NR==2{print $4}

5:ifconfig eth0 |awk /addr:[[:digit:]]/ {print $2} |sed s/addr://g

 

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/1992.html

服务器部署程序员系统优化网站设置运维