Unix VI Editor MCQs
VI Editor MCQs : This section focuses on "VI Editor" in unix. These Multiple Choice Questions (MCQ) should be practiced to improve the unix skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which editor is used by the UNIX system to edit files?
A. vi
B. sublime
C. notpad
D. word
View Answer
Ans : A
Explanation: vi editor is used in UNIX.
2. What is the default mode of vi editor?
A. Command mode
B. Read Mode
C. Write Mode
D. Execute Mode
View Answer
Ans : A
Explanation: The default mode of vi editor is command mode, where every key which is pressed is interpreted as a command to run on the text.
3. which mode is used for file handling and substitution?
A. Command mode
B. ex mode
C. def mode
D. Both A and B
View Answer
Ans : B
Explanation: ex mode performs various file handling and substitution operations like saving the file, quitting the editor, search and replace operations etc.
4. Esc key is used for?
A. switching to command mode from ex mode
B. switching to input mode from command mode
C. switching to command mode from input mode
D. switching to ex mode from input mode
View Answer
Ans : C
Explanation: To switch from the input mode to command mode press the "esc" key.
5. In vi editor ctrl-l is used to?
A. to delete one line from file
B. to save the file
C. to edit the file
D. clear the screen
View Answer
Ans : D
Explanation: If the screen gets garbled due to some reasons, we can use ctrl-l in command mode to wipe out.
6. While entering text in input mode the data is saved in _____
A. buffer
B. disk
C. RAM
D. cache
View Answer
Ans : A
Explanation: If the file has not been saved yet then whatever we are inputting in it is stored in a temporary storage called buffer. To save the data entered in the buffer, we have to switch to ex-mode.
7. Which operator is used to show unused line in VI editior?
A. $
B. #
C. !
D. ~
View Answer
Ans : D
Explanation: A tilde represents an unused line.
8. Which command is used to moves the cursor down one line?
A. i
B. j
C. k
D. l
View Answer
Ans : B
Explanation: j : Moves the cursor down one line
9. Which command is used to positions the cursor at the beginning of a line?
A. 0
B. !
C. |
D. Both A and C
View Answer
Ans : D
Explanation: 0 or | : Positions the cursor at the beginning of a line.
10. Which command is used to moves a paragraph forward?
A. (
B. [
C. {
D. }
View Answer
Ans : D
Explanation: } : Moves a paragraph forward
Discussion