How do I edit a file in Linux VI?

How do I edit a file in Linux VI?
Answer
How to edit file using vi utility on Linux?
  1. Connect to the server via SSH.
  2. Install improved vi editor: # yum install vim -y (CentOS/RHEL/CloudLinux)
  3. Start editing the required file by typing:
  4. In the text editor, press computer’s i key to edit the file.
  5. After editing the required string or pasting the text, press Esc button.
  6. To discard the changes, type :q!
 

Tìm kiếm

Back
Top