Frequent Question: How Do You Exit a File in Linux?
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). P Paste a Line of Yanked Text...
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). |
| p | Paste a line of yanked text below the current line. |
How do you exit in Linux?
To exit without saving changes made:
- Press < Escape> . (You must be in insert or append mode if not, just start typing on a blank line to enter that mode)
- Press : <colon>. The cursor should reappear at the lower left corner of the screen beside a colon prompt. …
- Enter the following: q!
- Then press <Enter>.
Must Read
How do you exit a text file?
You can press the Esc key. Type SHIFT Z Z to save and exit.