I\'m trying to create script that I can input a set of prefixes, which will then list all IP addresses within the prefixes (including network/host/broadcast).
An ex
Wanted to comment on an answer above but don't have the rep yet.
Using the top solution with NMAP I added this to my .bashrc
.bashrc
expand-ip() { nmap -sL -n -iL "$1" | awk '/Nmap scan report/{print $NF}' }
Now I can use this with just expand-ip targs.
expand-ip targs