Monthly Archives: December 2009

Basic UNIX Vi Usage

Using Vi from the terminal window to edit files

Basic Cursor use

Basic Cursor use Vi
Basic Cursor use Vi
  • k Up one line
  • j Down one line
  • h Left one line
  • l Right oen character (or spacebar)
  • w Right one word
  • b Left oen word


  • i Enter text entry mode
  • x Delete one character
  • dd Delete a whole line
  • r Replace a single character
  • R Overwrite text, to end


* To exit you must be in command mode-press if you are not in command mode * You must press after commands that begin with a : (colon)

  • ZZ Write (if there were changes), then quit
  • :wq Write, then quit
  • :q Quit (will only work if file has not been changed)
  • :q! Quit without saving changes to file