Skip to content

Instantly share code, notes, and snippets.

@ssstonebraker
Created April 9, 2018 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssstonebraker/5292b52a67985bcda023f1244909c52e to your computer and use it in GitHub Desktop.
Save ssstonebraker/5292b52a67985bcda023f1244909c52e to your computer and use it in GitHub Desktop.
ipextract
# Add this to your bash profile
ipextract () {
# example: ipextract < filename
egrep --only-matching -E '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment