比如网络接口是 ra0,ifconfig ra0后会显示许多信息,但我们只想要ip地址。那么用下面的指令
从ifconfig的结果中直接取出ip地址:
ifconfig ra0 |sed -n '2p2q' | awk '{print $2}' | cut -b 6-
比如网络接口是 ra0,ifconfig ra0后会显示许多信息,但我们只想要ip地址。那么用下面的指令
从ifconfig的结果中直接取出ip地址:
ifconfig ra0 |sed -n '2p2q' | awk '{print $2}' | cut -b 6-
相关文章: