VI changing to lowercase

I don’t know why I can never remember this one, but here it is for reference:

:%s/.*/\L&

.* = Match line
& = What was matched

No need for /g as .* already matches the line, and .* if faster than /g

This entry was posted in AIX, Linux and tagged , . Bookmark the permalink.

One Response to VI changing to lowercase

  1. morsing says:

    And here’s another one, replacing with newline CR/LF:

    :s/,/,^M/g

    ^M = ctrl-V ctrl-M

Leave a Reply