0
点赞
收藏
分享

微信扫一扫

快速检测一个段内哪些主机能PING通

Star英 2023-06-04 阅读 47

#!/bin/bash

i=1

while ((i <= 254))
do
    {
    ping -c 1 192.168.190.$i > /dev/null
    if [ $? == 0 ];then
        echo 192.168.190.$i
    fi
    }&
    let 'i+=1'
done
wait


# bash ping.sh | sort -t. -k4 -n

举报

相关推荐

批量ping检测主机

0 条评论