ubuntu中如何提取eth0的IP和子网掩码?

2025-05-05 17:24:43
推荐回答(1个)
回答1:

$ ifconfig eth0 | sed -r -n 's/.*inet addr:(\S+).*Mask:(.*)/\1 \2/p'