sed command is used to edit a file without opening. sed is the acronym for StreamEditor. The “sed” command is used to modify or change the contents of a file
For example, we have a text file with below content
>cat file.txt
We want to replace the content of the file and we want to replace “sed” with “vi”. So, we will use below command for this.
>sed 's/sed/vi/' file.txt
vi command is used to edit a file.
So, sed is replaced with vi in the text.