Commenting multiple lines in a file with vi editor
From command mode, type
: n1,n2s/^/#/
n1, n2 are the first and last line that need to comment
example: comment from line 10-20 use
: 10,20s/^/#/
And to uncomment, we use: n1,n2s/^/#/
n1, n2 are the first and last line that need to comment
example: comment from line 10-20 use
: 10,20s/^/#/
: n1,n2s/#/
Comments
Post a Comment