This set of Unix Multiple Choice Questions & Answers (MCQs) focuses on “Navigation in Vi Editor – 1”.
1. For navigation purposes, the mode should be _____ mode.
a) command
b) input
c) insert
d) ex
View Answer
Explanation: To execute navigation commands, the user should be in command mode of vi editor.
2. Which of the following keys are used to moving the cursor up and down?
a) k
b) h
c) l
d) k and j
View Answer
Explanation: For moving the cursor up and down, we can use ‘k’ and ‘j’ keys respectively.
k – moves the cursor up
j – moves the cursor down
3. Which of the following keys is used to moving cursor leftwards along a line?
a) k
b) h
c) l
d) j
View Answer
Explanation: For moving the cursor towards left, we can use ‘h’ key.
4. Which one of the following keys are used to moving cursor rightwards along a line?
a) k
b) h
c) l
d) j
View Answer
Explanation: For moving the cursor towards the right, we can use ‘l’ key.
5. We can prefix the repeat factor with navigation keys (h, j, k and l).
a) True
b) False
View Answer
Explanation: The repeat factor can be used as a command prefix with all these four commands. For example, to move 20 characters to the right, we can use ’20l’.
6. Which one of the following command is invalid?
a) 20h
b) 5l
c) 4k
d) 3d
View Answer
Explanation: All the above commands except 3d are navigation commands with prefixed repeat factor.
7. We can perform word navigation in vi editor.
a) True
b) False
View Answer
Explanation: Moving character by character is not always enough so we can perform navigation word by word by using word navigation commands (b, e and w).
8. Using ‘b’ command we can _____________
a) move back to the beginning of the word
b) move forward to the end of the word
c) move forward to the beginning of the word
d) move back to the end of the word
View Answer
Explanation: We can use ‘b’ command to move back to the beginning of the word. To do so, simply press ‘b’ once for performing navigation a single time.
9. Using ‘e’ command we can _____________
a) move back to the beginning of the word
b) move forward to the end of the word
c) move forward to the beginning of the word
d) move back to the end of the word
View Answer
Explanation: We can use ‘e’ command to move forward to the end of the word. To do so, simply press ‘e’ once for performing navigation a single time.
10. Using ‘w’ command we can _____________
a) move back to the beginning of the word
b) move forward to the end of the word
c) move forward to the beginning of the word
d) move back to the end of the word
View Answer
Explanation: We can use ‘w’ command to move forward to the beginning of the word. To do so, simply press ‘w’ once for performing navigation a single time.
Sanfoundry Global Education & Learning Series – Unix.
To practice all areas of Unix, here is complete set of 1000+ Multiple Choice Questions and Answers.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Check MCA Books
- Apply for Computer Science Internship
- Practice Computer Science MCQs
- Check Unix Books
- Practice MCA MCQs