Posted in linux

vi commands

Basic vi commands

Cheat sheet (pdf)

  • replace: %s/old/new/g
  • search: /text
  • repeat search: n
  • save: w
  • quit: q
  • quit without saving: q!
  • quit and save: ZZ
Advertisements