1、
ip addr|grep inet|grep -v inet6|grep ens|awk '{print $2}'|sed 's/\/.*//'
2、
hostname -i | awk {'print $1'}