Skip to content

Instantly share code, notes, and snippets.

@hidsh
Last active January 22, 2022 15:07
Show Gist options
  • Save hidsh/7213fff3b2d361d5ee0a636e9eb2fb2b to your computer and use it in GitHub Desktop.
Save hidsh/7213fff3b2d361d5ee0a636e9eb2fb2b to your computer and use it in GitHub Desktop.
Mac: アドレス範囲(192.168.1.1〜254)をpingする
#!/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
@hidsh
Copy link
Author

hidsh commented Jan 22, 2022

ttl

  • 64: Linux, Mac OS
  • 128: Windows
  • 255: Unix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment