ifconfig | awk '/inet addr/' | awk '!/127.0.0.1/' |awk -F ':' '{print $2}' |awk '{print $1}' (#centos6)
ifconfig | awk '/inet/'|awk '!/inet6|127.0.0.1/'|awk '{print $2}' (#centos7.3)
echo -e `for i in {1..254}; do ping -W1 -c1 192.168.77.$i ;done` > /dev/null && arp -n | awk '/:/' | sort -t. -k4 -n
(#循环{a..b}需求bash 4.0+)