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*

4
  • 2
    You should consider expanding your answer with a little more information for the uninitiated (e.g., exactly what the regex you use does). Commented Jul 26, 2014 at 21:01
  • 1
    egrep is depreciated. Use grep -Ev instead. Commented Jan 11, 2018 at 8:20
  • 1
    This is the tightest, most elegant answer. Thanks Nikola! Commented Mar 26, 2022 at 10:14
  • A +1 comment from me for a reason: This is not only the tightest, most elegant answer, it's also memorable, expandable, and reasonable. The intention of removing comments is not hunting comment characters for sport, but to get rid of verbose section headers, irrelevant option lines and useless white space. This fits the purpose perfectly. A comment after a command/option won't disturb in 99% of cases, the contrary is true: It is helpful to read the output. Commented Oct 14 at 6:35