首页 > 系统服务 > 详细

shell脚本检测局域网内存活主机

时间:2015-07-14 13:06:34      阅读:770      评论:0      收藏:0      [点我收藏+]

<1>

d211 admin # for i in {3..254} ; do ping -c 1 192.168.1.$i &>/dev/null && echo 192.168.1.$i is alive ;done
192.168.1.5 is alive
192.168.1.7 is alive

<2>

fping -a -g 192.168.5.1 192.168.5.177 -s -n >lele.txt

-a   Show systems that are alive.

-g   Generate a target list from a supplied IP netmask, or a starting and ending IP. Specify the net mask or start/end in the targets portion of the command line.

ex. To ping the class C 192.168.1.x, the specified command line could look like either:

fping -g 192.168.1.0/24  or   fping -g 192.168.1.0 192.168.1.255

-s   Print cumulative statistics upon exit.                        -n   Same as -d.

-d   Use DNS to lookup address of return ping packet. This allows you to give fping a list of IP
addresses as input and print hostnames in the output.

shell脚本检测局域网内存活主机

原文:http://www.cnblogs.com/itcomputer/p/4645019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!