How do I save and exit in Linux?

How do I save and exit in Linux?
Answer
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).
 

Tìm kiếm

Back
Top