Which command will be used with vi editor to replace single character under cursor with any number of characters? A. s B. S C. a D. i E. None of the above

s
S
a
i E. None of the above

The correct answer is A. s.

The command s is used to substitute one character for another. To use it, type s followed by the character you want to replace, then the character you want to replace it with. For example, to replace the letter “a” with the letter “b”, you would type s/a/b/.

The command S is similar to s, but it replaces a whole word instead of just a single character. To use it, type S followed by the word you want to replace, then the word you want to replace it with. For example, to replace the word “cat” with the word “dog”, you would type S/cat/dog/.

The command a is used to append text at the cursor position. To use it, type a followed by the text you want to append. For example, to append the word “the” after the word “cat”, you would type athe.

The command i is used to insert text at the cursor position. To use it, type i followed by the text you want to insert. For example, to insert the word “the” before the word “cat”, you would type ithecat.

Therefore, the correct answer is A. s.

Exit mobile version