Being an ISP admin, I have regular need to find IP addresses listed in large logfiles. The following will grab anything that appears to be an IP and list it out for you, from there you can sort or whatever you want to do with the list.
perl -ne 'print "$&n" while m#d+.d+.d+.d+#g' <logfile>
Or just throw it in a bash script for easier remembering:
#!/bin/bash perl -ne 'print "$&\n" while m#\d+\.\d+\.\d+\.\d+#g' $1;