检测局域网中还可用的ip地址

#!/bin/bash

for i in `seq 1 254`
do
{
ping -c2 192.168.1.$i &>/dev/null
if [ $? != 0 ];then
echo "192.168.1.$i is not used"
fi
}
done
原文地址:https://www.cnblogs.com/zejin2008/p/4922737.html