Sed works with threads and outputs its output to standard.
It does not modify the input file.
It is usually used when you want to write its output to a file:
#
The above command calls sed on input-file and redirects the output to a new file called output-file .
Depending on your platform, you can use the sed -i option to modify files:
sed -i.bak 's/foo/bar/g' input-file
NOTE:
Not all versions of sed -i support.
In addition, different versions of sed implement -i differently.
On some platforms, you MUST specify an extension for backup (on others that you do not need).
source share