Finding and replacing whole line using sed

Hi all,

assume that i am having the following line in a file called file1.

     triumph and disaster must be treated same.

I want to replace this line with.

     follow excellence success will chase you.

is it possible to do this using sed. if possible kindly post me the code.

sed -i 's/triumph and disaster must be treated same./follow excellence success will chase you./' file1
1 Like

Hi kato,

Thanks it works!!!