How do you edit the file in Linux and save it?

How do you edit the file in Linux and save it?
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

i

Switch to Insert mode.

Esc

Switch to Command mode.

:w

Save and continue editing.

:wq or ZZ

Save and quit/exit vi.
 

Tìm kiếm

Back
Top