Append line after match

Append a setting line after the [defaults] header

sed '/^\[defaults\]/a ansible_python_interpreter=/usr/bin/python3' ansible.cfg

tool
sed15 commands
tags
sedlinux

More sed commands

all 15 sed commands