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

Remove line matching "pattern" from file

sed -i '/pattern/d' file

~~~

Back to Techne index

Back to unixcat.coffee