Quick Answer: How to Use Vi in Linux?
Contents

How to edit file using vi utility on Linux?

  • Connect to the server via SSH.
  • Install improved vi editor: # yum install vim -y (CentOS/RHEL/CloudLinux)
  • Start editing the required file by typing:
  • In the text editor, press computer’s i key to edit the file.
  • After editing the required string or pasting the text, press Esc button.
  • To discard the changes, type :q!

What is vi editor Linux?

The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate editors for UNIX environments include pico and emacs, a product of GNU.] The UNIX vi editor is a full screen editor and has two modes of operation: Command mode commands which cause action to be taken on the file, and.

How do I type in vi?

  1. To enter vi, type: vi filename <Return>
  2. To enter insert mode, type: i.
  3. Type in the text: This is easy.
  4. To leave insert mode and return to command mode, press: <Esc>
  5. In command mode, save changes and exit vi by typing: :wq <Return> You are back at the Unix prompt.
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest