sed -i '//s/^/#/g' file #comment sed -i '//s/^#//g' file #uncomment