TECHIES WORLD

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

Linux

How to add # to the beginning of a line containing the keyword in bash

We can use the sed utility to add # to the beginning of a line containing the keyword.

#sed 's/.*KEY/#&/' NAME

Where KEY need to be replaced with the keyword and NAME need to be replaced with the file name.

That's all…