ifconfig enp0s5 | sed -n '2p'
ifconfig enp0s5 | sed -n '2p'| sed 's#^.*dr:##g'
ifconfig enp0s5 | sed -n '2p'| sed 's#^.*dr:##g'|sed ’s# B.*$##g'
ifconfig enp0s5 | sed -nr ’s#^.*dr:(.*) B.*$#\1#gp’
Awk的读取ifconfig的ip地址
ifconfig enp0s5 |awk -F “[ :]+” ’NR=2 {print $4}’