Monday, August 16, 2010

Vi quick reference for DBAs

Here are a few useful commands for those who are new to vi.

esc :q!Just quit - don't save
esc :e!Revert to saved
esc :wqSave and exit
esc shift zzSave and exit
esc iEnter insert mode (edit mode)
esc aEnter append mode (edit mode)
escExit edit mode
esc rReplace a single character
esc xDelete a single character
esc ddDelete a single line
esc yyCopy a single line
esc pPaste a single line
.Repeat the last command
esc /String search
esc $Jump to end of line
esc ^Jump to begining of line
shift gJump to the end of the file
:1Jump to the begining of the file
:.=Display the current line number

No comments: