How Do I Save Changes to a File in Linux?
Contents How Do I Save and Edit a File in Linux? to Save a File, You Must First Be in Command Mode. Press Esc to Enter Command Mode, and Then Type: Wq to Write...
Contents
How do I save and edit a file in Linux?
To save a file, you must first be in Command mode. Press Esc to enter Command mode, and then type :wq to write and quit the file.
…
More Linux resources.
| Command | Purpose |
|---|---|
| $ vi <filename> | Open or edit a file. |
| i | Switch to Insert mode. |
| Esc | Switch to Command mode. |
| :w | Save and continue editing. |
Must Read
How do I save changes in Unix?
Be sure to use the save command often when editing an important document.
…
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 |