How do I make a backup of a file when editing with sed?
hoodedvul last edited by
-i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied)
-ioption add a suffix. This will create a backup file called breakfastbackup
$ sed -ibackup '/coffee/d' breakfast
© Lightnetics 2022