Skip to content

Instantly share code, notes, and snippets.

@zyjibmcn
Last active June 2, 2016 05:22
Show Gist options
  • Save zyjibmcn/4378e06cf3f57037a20f5467ed484c20 to your computer and use it in GitHub Desktop.
Save zyjibmcn/4378e06cf3f57037a20f5467ed484c20 to your computer and use it in GitHub Desktop.
linux sed - remove multiple lines comment block

=== remove single line comment

   eg: <!-- -->
   
   sed -i '/<!--.*-->/ d' file

=== remove multiple lines of comments

    eg:
    <!--
     abc
     def
    -->
    
    sed -i '/<!--/,/-->/ d' file
    Note: the , implied the multiple lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment