Last active
January 22, 2022 15:07
-
-
Save hidsh/7213fff3b2d361d5ee0a636e9eb2fb2b to your computer and use it in GitHub Desktop.
Mac: アドレス範囲(192.168.1.1〜254)をpingする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
base=192.168.1 | |
#beg=1 | |
#end=254 | |
# Mac (Mac's ping command has some different options (e.g. -i) than that of Linux?) | |
echo ${base}.{1..254} | xargs -P999 -n1 ping -c1 -t1 -i2| grep ttl | |
#for ((i = ${beg} ; i <= ${end} ; i++)); do ping -c 1 -i 1 -q ${base}.${i}; done | |
# windows? | |
# for /l %i in (%start,1,%end) do ping -n 1 192.168.1.%i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ttl