Chinaunix

标题: Scan Range of IP Addresses [打印本页]

作者: dow    时间: 2009-04-20 21:49
标题: Scan Range of IP Addresses
On my home network I often need to know which IP addresses have devices connected to them. The following one-liner will scan a given range and let you know whether each IP can be pinged.
for IP in 192.168.1.{1..10}; do if ping $IP -c 1 > /dev/null; then echo $IP alive; else echo $IP dead; fi; done


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40227/showart_1904839.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2