TECHIES WORLD

For Techs.... Techniques.... Technologies....

BashLinux

How to replace line containing the keyword in Bash

We can use the sed command to replace line containing the keyword in Bash.

#sed -i 's/.*KEYWORD.*/REPLACE-LINE/' FILENAME

Where KEYWORD, REPLACE-LINE and FILENAME need to be replaced with the appropriate values.

That's all…