Created
December 29, 2011 03:00
-
-
Save cowboy/1531434 to your computer and use it in GitHub Desktop.
I want to know what machines I have on my network. Is there a better (also faster) way than to ping machines 192.168.0.1 - 192.168.0.255?
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/bash | |
| for oct in {1..254}; do | |
| ip="192.168.0.$oct" | |
| echo -en "\033[s$ip" | |
| ping -c 1 -t 1 "$ip" >/dev/null 2>&1 && echo || echo -en "\033[1K\033[u" | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. Since writing this snippet, I did a little research and came up with a shell script wrapper around
nmap:https://github.com/cowboy/dotfiles/blob/master/bin/scan