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 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.

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!

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest