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“