Esta questão é formulada como uma questão de lição de casa. Você aprenderá muito pouco com a resposta dada a você.
g/^#/m$Apply the move-to-end command (m$) to all lines matching/^#/. All that is missing is to write the result back to the original file. For an extra challenge, combine this with your last question and come up with a way of commenting out line 10 through to 20 and move them to the end of the file, not touching other commented out lines.