Search notes:

sed: In place editing

Without backup:

sed -i changes the content of a file without creating a backup.
sed -i s/PAT/REPL/ /path/to/file

With backup:

If the -i is followed by a suffix, a corresponding backup is created before the file is edited.
The following example Creates the backup file /path/to/file.bak and modifies /path/to/file.
sed -i.bak s/PAT/REPL/ /path/to/file

See also

Inplace editing with Perl and PowerShell.
sed

Index