Skip to content

Instantly share code, notes, and snippets.

@missinglink
Created December 13, 2013 11:45
Show Gist options
  • Select an option

  • Save missinglink/7943151 to your computer and use it in GitHub Desktop.

Select an option

Save missinglink/7943151 to your computer and use it in GitHub Desktop.
Find all occurrences of IP addresses & the string 'localhost' in a given directory. (excluding the 'node_modules' directory)
#!/bin/bash
find . | grep -v node_modules | xargs grep -P '([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|localhost' 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment