Skip to content

Instantly share code, notes, and snippets.

@jwilkins
Created October 31, 2012 00:48
Show Gist options
  • Save jwilkins/3984126 to your computer and use it in GitHub Desktop.
Save jwilkins/3984126 to your computer and use it in GitHub Desktop.
ack for hostnames & ip addresses in a source tree (given a domain name)
# hostnames
ack -oa '((\w+\.){1,3}domainname(\.\w+){1,3})' | cut -f3 -d':' | sort| uniq
# ipv4 addresses
ack -oa '((\d+\.){3,3}\d+(:\d+)?)' | cut -f3-4 -d':' | sort| uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment