In this tutorial, we will explore sed’s most useful command-line flags. Knowing these flags will bring your sed mastery to the next level.
Nice. For the inplace flag, you could add some text to be appended to file to create a backup file, e.g:
sed -i.bak '1p' file.txt
This will create a backup file: file.txt.bak
Nice. For the inplace flag, you could add some text to be appended to file to create a backup file, e.g:
sed -i.bak '1p' file.txt
This will create a backup file: file.txt.bak