How do I edit a file in Linux VI?

How do I edit a file in Linux VI?
Answer
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.
 

Tìm kiếm

Back
Top