Common Linux vi Operation and Editing Commands

Tech Sharing 2017-12-19
Common Linux vi Operation and Editing Commands

A quick reference for common vi commands: entering edit mode, undo/restore, deleting lines, and file operations like save and quit.

Entering edit mode

A   append at the end of the current line
u   undo the last change
U   restore the current line
dd  delete the current line
Esc exit edit mode

File operations

:x       quit; save first if modified
:q       quit
:q!      force quit
:w       write (save)
:w!      write, ignoring warnings
:w! file overwrite the given file, ignoring warnings
:wq      save and quit