When running a command with output that will be publicly available, you may not want to show IP addresses. This might come up with output from a freemium continuous integration (CI) service like TravisCI or CircleCI, for example. Pipe output into the following command to redact the first three segments:
sed -E 's/[0-9]+\.[0-9]+\.[0-9]+\.([0-9]+)/███.███.███.\1/g'
The squares are the Unicode "full block" character. Example use:
$ ansible-playbook -i digital_ocean.py --list-hosts playbooks/test.yml | sed -E 's/[0-9]+\.[0-9]+\.[0-9]+\.([0-9]+)/███.███.███.\1/g'