VI Editor modes Overview

The is the most popular and classic text editor in Linux. VI editor has three modes of operations

VI Editor modes
  • Insert mode
  • Ex Mode (Extended Command Mode)
  • Command Mode

Insert Mode

  • I – Insert the text at the current cursor position
  • a – Adds the text after the current cursor position
  • A – Adds the text at the end of the line
  • o – Insert the text one line below the current cursor position
  • O – Insert the text one line above current cursor position

Ex Mode

  • :q – Quit without saving text
  • :q! – Quite forcefully without saving text
  • :w – Write input text
  • :wq – Write and quite
  • :wq! – Write and quite forcefully
  • :5 – Cursor goes to line 5
  • :se nu – show line numbers
  • :se nonu – Remove line numbers

Command Mode

  • dd – Delete a line
  • sdd – Delete ‘s’ line
  • yy – Copy a line
  • syy – Copy ‘s’ line
  • p – Put (our text)
  • u – Undo Changes
  • G – Moves the cursor to the last line of the file

If you have any kind of problem in this whole process, then you can ask me by commenting. If you want to get more information related to Linux Group file Understanding, you can also read other blogs by clicking on the link above

 Thanks to all of you guys for reading my blog.

Author: Rahul Gehlaut more blog read

About Rahul Gehlaut

Cyber Security Researcher, CTF Player. Tech Blog Writer.

View all posts by Rahul Gehlaut →