Last active
June 15, 2024 16:12
-
-
Save ritiek/08b0ff0e88dc7e5cff6c24b8f032e57e to your computer and use it in GitHub Desktop.
Scan for active local IP addresses and resolve their machine names
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
# Replace "192.168.2.{}" as per your gateway address. | |
seq 1 254 | xargs -I {} "echo" "192.168.2.{}" | parallel -j 254 "ping -t 1 -c 1 {} > /dev/null && (timeout 1 avahi-resolve -a {} || echo {})" 2> /dev/null | sort -V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment