Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Are the double ' after the -i option intentional? Didn't need them. Commented Mar 26, 2015 at 9:50
  • 2
    +1 for considering OSX systems in your response <3 Commented May 30, 2020 at 23:41
  • For some reason I continued to get a unterminated 's's Error every time I tried your command. This was because there was a space in-between the lines and the s. Had to remove the space to get it to work sed -i '2,4s/^/#/' bla.conf Commented Dec 3, 2021 at 16:43