for ip in $(seq 1 254);do ping -c 1 192.168.18.$ip;done | grep ttl
此条命令就是使用自带shell语言,进行了一个循环ping操作,找出存活的主机。