Sed

Comment a line that contains a specific string

sed -i '/<pattern>/s/^/#/g' file

Uncomment a line that contains a specific string

sed -i '/<pattern>/s/^#//g' file

~~~

Last updated: 2021-11-19

Back to Techne index

Back to unixcat.coffee