sed command FAQ: How can I use the Unix/Linux sed command to edit (modify) files in place?
The short answer is that you just need to use the -i or --in-place sed arguments, as shown in the sed man page:
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
Then, if you have a file named 'hello.txt' with contents like this:
jello, world
this is a test
you can then run a sed command like this to modify that file: