2021年9月6日 星期一

How to get IP by command? (Linux)

 How to get IP by command? (Linux)

Ubuntu:
ip addr show | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*


Centos:
ifconfig | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*

(TOP)Temp for soulin only

123