sed [opts] [script] [file]
opts:
-i edit file in place
-i.bk edit file in place and create backup file
(with .bk suffix, can be specified differently)
--follow-symlinks
follow symlinks when editing in place
-e SCRIPT add SCRIPT to commands to be executed
(can be specified multiple times)
-f FILE add content of FILE to command to be executed
--debug annotate program execution
touch file
ln -s file link
ls -l link
# lrwxrwxrwx 1 johannst johannst 4 Feb 7 23:02 link -> file
sed -i --follow-symlinks '1iabc' link
ls -l link
# lrwxrwxrwx 1 johannst johannst 4 Feb 7 23:02 link -> file
sed -i '1iabc' link
ls -l link
# -rw-r--r-- 1 johannst johannst 0 Feb 7 23:02 link