Skip to content

Instantly share code, notes, and snippets.

@sayantanHack
Last active December 2, 2023 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayantanHack/0b07a9db661c73f9c93bebcf7ecc69b7 to your computer and use it in GitHub Desktop.
Save sayantanHack/0b07a9db661c73f9c93bebcf7ecc69b7 to your computer and use it in GitHub Desktop.
This will get all IPs available in the same Subnet. You have to provide upto 3rd octate
#!/bin/bash
if [ "$1" == "" ]
then
echo "Usage: ./ipfinder.sh [network IP]"
echo "Example: ./ipfinder.sh 192.168.0"
else
for ip in `seq 1 254`; do
ping -c 1 $1.$ip | grep "64 byte" | cut -d " " -f 4 | sed 's/.$//' &
done
fi
@sayantanHack
Copy link
Author

You have to provide upto 3rd octate.
./ipfinder.sh 192.168.0

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