How Do You Save and Exit in Unix?
Contents 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). How Do You Save in Unix? Note...
Contents
| 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). |
How do you save in Unix?
NOTE: The :! and :sh commands make it easy to execute UNIX commands without exiting Vi.
…
bold.
| :w | save changes (i.e., write) to your file |
|---|---|
| :wq or ZZ | save changes to file and then qui |
| :! cmd | execute a single command (cmd) and return to vi |
| :sh | start up a new UNIX shell – to return to Vi from the shell, type exit or Ctrl-d |
Must Read
How do I save and exit vi file?
To get into it, press Esc and then : (the colon). The cursor will go to the bottom of the screen at a colon prompt. Write your file by entering :w and quit by entering :q . You can combine these to save and exit by entering :wq .