Quick Answer: How Do I Edit a File in Vi Editor Linux?
Contents How Do I Edit a File in Linux Vi? to Save a File, You Must First Be in Command Mode. Press Esc to Enter Command Mode, and Then Type: Wq to Write and...
Contents
How do I edit a file in Linux VI?
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 |
|---|---|
| i | Switch to Insert mode. |
| Esc | Switch to Command mode. |
| :w | Save and continue editing. |
| :wq or ZZ | Save and quit/exit vi. |
Must Read
How do I open and edit a file in vi?
To open a file in the vi editor to start editing, simply type in ‘vi <filename>’ in the command prompt. To quit vi, type one of the following commands in the command mode and press ‘Enter’. Force exit from vi even though changes haven’t been saved – :q!