Multiple choice unix

Which command will be used with vi editor to insert text to left of cursor?

  1. s

  2. S

  3. a

  4. i

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In vi editor, the 'i' command inserts text to the left of (before) the cursor position. 'a' appends text to the right, 's' substitutes current character, 'S' substitutes entire line.

AI explanation

To answer this question, you need to understand the basic commands used in the vi editor.

Option A) s - This option is incorrect because the s command is used to substitute characters. It deletes the character under the cursor and enters insert mode.

Option B) S - This option is incorrect because the S command is used to delete the current line and enter insert mode at the beginning of the line.

Option C) a - This option is incorrect because the a command is used to append text after the cursor. It enters insert mode after the current character.

Option D) i - This option is correct because the i command is used to insert text to the left of the cursor. It enters insert mode before the current character.

Therefore, the correct answer is option D) i.