SED - zhuje/openshift-wiki GitHub Wiki
sed -i '' '/^text to delete/ d' file.txt

https://stackoverflow.com/questions/38678692/shell-script-edit-files-line
sed -i '' 's/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g' filename
https://stackoverflow.com/questions/12696125/sed-edit-file-in-place
Append at the end of the file is usually done but echo
but it can also be done with sed
.
$ echo "This is last line" >>file
OR
sed -i -e '$a\'$'\n''This line was appended at the end.' test.txt
https://stackoverflow.com/questions/61144810/how-to-append-a-line-at-the-end-of-the-file-using-sed
sed -i '\%foo-keyword% s/^/#/' file
sed '/bean/s/^# *//' file.txt