Skip to content

Instantly share code, notes, and snippets.

@lordkhonsu
lordkhonsu / gist:7eca5cbf0440589946c7
Last active February 19, 2023 23:15
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'