The change command

We saw how to substitute occurrences using the substitute command s. So what is the change command and how is it different?

The change command, c, is used for changing the entire line.

To change a line, you can use the change command like this:

$ sed '2c\modified the second line' myfile  

We replaced the second line with a new line.