Comment / un-comment a line in a config file, matching a pattern, using sed
sed -i '/pattern/s/^/#/g' file #to comment out sed -i '/pattern/s/^#//g' file #to uncomment