How Do I Save and Exit Vim in Linux?

How Do I Save and Exit Vim in Linux?
Contents

How do you exit vim in Linux?

“Hit the Esc key,” dirvine says. Once you hit escape, “vim goes into command mode.” From there, dirvine offers nine commands you can enter to actually get out of Vim: :q to quit (short for :quit)

How do I save and exit in Linux?

Press Esc to enter Command mode, and then type :wq to write and quit the file. The other, quicker option is to use the keyboard shortcut ZZ to write and quit.
…
More Linux resources.

Command Purpose
:wq or ZZ Save and quit/exit vi.
:q! Quit vi and do not save changes.
yy Yank (copy a line of text).
Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.