All of the lines with comments in a file begin with #. How can I delete all of the lines (and only those lines) which begin with #? Other lines containing #, but not at the beginning of the line should be ignored.
All of the lines with comments in a file begin with # . How
Share
This can be done with a sed one-liner:
This says, “find all lines that start with # and delete them, leaving everything else.”