Unix Questions and Answers – Navigation in Vi Editor – 1

«
»

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

Answer: a
Explanation: To execute navigation commands, the user should be in command mode of vi editor.
advertisement

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

Answer: d
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

Answer: b
Explanation: For moving the cursor towards left, we can use ‘h’ key.
advertisement
advertisement

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

Answer: c
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

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

6. Which one of the following command is invalid?
a) 20h
b) 5l
c) 4k
d) 3d
View Answer

Answer: d
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

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

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

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

Answer: b
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.
advertisement

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

Answer: c
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.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter