in Linux

How to use Vi editor in Linux

how to use vi editor
If you use Linux on a day to day basis for daily work, you may find Vi editor very useful for some quick changes.

Here are some key commands which you may find useful.

Load File using Vi editor:

  • #vi file-name

Edit / Make Changes:

  • Hit: “i”
  • You will notice — INSERT — will be visible at bottom left of the terminal.
  • Now, you can mover the cursor and add / edit / delete as required.

Save & Exit:

  • Hit: “Esc”
  • You will notice –INSERT– will disappear.
  • Type “:”
  • You will notice : will appear at the bottom left.
  • The type wq, it will appear like “:wq”
  • Hit Enter and you will come out and file will be saved.

Find or Search in Vi editor:

  • Load file using Vi ediot
  • Just type “/keyword” and hit enter
  • To find next match just hit “N
Written By:

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.