# IP Sweep



```bash
#!/bin/bash 

if [ "$1" == "" ]
then 
echo "You forgot an IP address"	
echo "Syntax: ./ipsweep.sh 192.168.198"

else
for ip in `seq 1 254`; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
fi
```

```
How to use:
./ipsweep.sh 192.168.198

./ipsweep.sh 192.168.198 > ips.txt

How to use with nmap:
for ip in $(cat ips.txt); do nmap $ip; done

# the & sign is much faster than ; sign
for ip in $(cat ips.txt); do nmap $ip & done
```
