Exam LFCS All QuestionsBrowse all questions from this exam
Question 56

What is the difference between the i and a commands of the vi editor?

    Correct Answer: B

    In the vi editor, 'i' (insert) command is used to insert text before the current cursor position, while 'a' (append) command is used to insert text after the cursor. When 'i' is used, the text is inserted starting from the current cursor location. When 'a' is used, the cursor moves one position to the right, and text is then inserted starting from the new cursor location. This distinction allows for precise control over text insertion within the editor.

Discussion
StribOption: B

B. i (insert) inserts text before the current cursor position whereas a (append) inserts text after the cursor. In the vi editor, the "i" command is used to enter the insert mode, which allows you to insert text before the current cursor position. When you are in insert mode, any text you type will be added at the location of the cursor. On the other hand, the "a" command is used to enter the append mode, which allows you to insert text after the cursor position. When you are in append mode, any text you type will be added immediately after the cursor. Here's a summary of the difference between the "i" and "a" commands in vi: "i": Enters insert mode and allows inserting text before the current cursor position. "a": Enters append mode and allows inserting text after the current cursor position. By using these commands, you can efficiently edit and modify text within the vi editor.

passnowOption: B

B is correct. without pressing i and making it active you can't type anything in the vi editor, as it helps you add text to the editor.

BorbzOption: B

B is correct.