250+ TOP MCQs on Vi Basics and Modes and Answers

Unix Questions and Answers for Experienced people on “Vi Basics and Modes”.

1. ex-mode is used to save our work.
a) True
b) False

Answer: a
Clarification: One of the major functions performed in ex-mode is, saving our work. For example, to save our file invoke the following command :

:w [Enter]
"file001", 10 lines, 456 characters

2. Commands inputted in command mode don’t appear on the terminal.
a) True
b) False

Answer: a
Clarification: Command mode is the mode in which we can pass commands to act on text, using most of the keys of the keyboard. Pressing a key doesn’t show it on screen but may perform a function like moving the cursor to the next line, deleting a line etc.

3. To clear the screen in vi editor, _____ is used.
a) ctrl-h
b) ctrl-l
c) ctrl-p
d) ctrl-v

Answer: b
Clarification: If the screen gets garbled due to some reasons, we can use ctrl-l in command mode to wipe out. It will simply clear your terminal.

4. vi commands are not case sensitive.
a) True
b) False

Answer: b
Clarification: vi commands are case-sensitive. For example, ‘a’ and ‘A’ are different commands.

5. While entering text in input mode the data is saved in _____
a) buffer
b) disk
c) RAM
d) cache

Answer: a
Clarification: 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.

6. To quit vi editor without saving the buffer we can use
a) :q
b) :c
c) :w
d) :q!

Answer: d
Clarification: For quitting vi editor, there are numerous ways available in ex-mode as well as in command mode. One way of which is to type ‘:q!’ in ex-mode.

7. The first UNIX editor was ____
a) emacs
b) ex
c) ed
d) vi

Answer: c
Clarification: The first editor that was used in UNIX systems was ‘ed’. The main reason behind the replacement of ‘ed’ was that it can only edit files in the current directory and cannot execute shell commands.

8. One of the most important features of vi editor is _______
a) available mostly across all UNIX platforms
b) easy to learn
c) latest editor
d) powerful than other editors

Answer: a
Clarification: vi is a versatile editor which is now standard on all UNIX systems.

9. The “ed” text editor is no longer in use.
a) True
b) False

Answer: b
Clarification: ‘ed’ text editor is still in use but not that much as compared to vi, because the main reason behind the replacement of ‘ed’ was that it can only edit files in current directory and cannot execute shell commands.

Leave a Reply

Your email address will not be published. Required fields are marked *