sed

update IP

sed -i 's/10.0.0.22/172.16.4.117/' /tmp/myfile

Add '' for running sed command on macOS:

sed -i '' 's/10.0.0.22/172.16.4.117/' /tmp/myfile

Replace space with new line:

sed 's/ /\n/g' id_rsa