Last active
July 16, 2018 23:09
-
-
Save sinewalker/87f03f6ad25cad0bedbbd5895f0a9f0a to your computer and use it in GitHub Desktop.
Comment / un-comment a line in a config file, matching a pattern, using sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i '/pattern/s/^/#/g' file #to comment out | |
sed -i '/pattern/s/^#//g' file #to uncomment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment