You work as the Network Administrator for Tech Perfect Inc. The company has a Linux-based
network. You are working as a root user on the Linux operating system. You have created a file in
the vim text editor. You want to save this file and exit it. Which of the following keys should you
use to accomplish the task?
A.
:w
B.
:wq
C.
:q!
D.
:
Explanation:
creates a command prompt at bottom-left of screen. w will save the file and q will
quit from the file. When :wq is used in combination and then the Enter key is pressed, this will
save the file and exit it.
Answer option D is incorrect. : enters EX mode. EX mode will open a prompt on the last line of the
terminal, and will accept certain keys for commands.
Answer option A is incorrect. :w only saves a file on the disk. To quit from the file after saving its
contents, use q after :w.
Answer option C is incorrect. This key is used to quit from the file without saving its contents.