Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeRo1985/c1373a49b8ed19499d8bc07eda95a382 to your computer and use it in GitHub Desktop.
Save BeRo1985/c1373a49b8ed19499d8bc07eda95a382 to your computer and use it in GitHub Desktop.
bash sed anonymize ip adresses in file

This line will replace the last octet of ipv4 adresses in a given file with a zero:

sed -i '' -e 's/\(\([0-9]\{1,3\}\.\)\{3\}\)[0-9]\{1,3\}/\10/g' <filename>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment