This set of Unix Interview Questions and Answers for Experienced people focuses on “Vi Basics and Modes – 2”.
1. ex-mode is used to save our work.
Explanation: 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.
Explanation: 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.
Explanation: 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.
Explanation: 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 _____
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.
6. To quit vi editor without saving the buffer we can use
Explanation: 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 ____
Explanation: 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
Explanation: vi is a versatile editor which is now standard on all UNIX systems.
9. The “ed” text editor is no longer in use.
Explanation: ‘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.
Sanfoundry Global Education & Learning Series – Unix.
To practice all areas of Unix for Interviews, here is complete set of 1000+ Multiple Choice Questions and Answers.