SCA_SLES15 practice question 2 of 15
Which Vim command will save the current file without exiting?
Full set: 69 questionsIn Vim's command-line mode (accessed by pressing : in normal mode), the w command stands for "write". Executing :w saves the changes made to the file currently being edited to the disk. This action does not cause Vim to exit, allowing the user to continue editing the file after saving. This is the standard and most direct command to save the current file without exiting the editor.
A. q! quits the editor without saving any changes made since the last write. It discards the current work.
B. w-no-exit is not a valid Vim command. The command to write is simply w.
C. wq! forcefully writes the file and then quits the editor. This command exits Vim.
E. w! forcefully writes the file, which is used to overwrite read-only files. While it saves, the ! is unnecessary for a normal save operation.
- SUSE Linux Enterprise Server 15 SP5 Administration Guide, Section 5.2.2. "Basic VIM Commands", Table 5.1 "VIM Command Overview" lists :w with the description "Save file." and :q with "Quit VIM."
- vimtutor interactive tutorial, Lesson 1.4: "To save the changes made to the file, type :w ". This lesson clearly separates the save (:w) and quit (:q) commands.
Keep practicing
Take the free SCA_SLES15 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SCA_SLES15 practice questions
- Question 1Which option for zypper will list the available patches?
- Question 3Which file should be edited to make sure a file system is mounted each time a system boot…
- Question 4You have just added a new directory to be exported via NFS. what command should you run n…
- Question 5If you have a service named tftp, which command and options would enable tftp to start au…
- Question 6Which statements about log file rotation are true? (Choose two)
- Question 7By default, what does the VNC Client and the VNC server daemon use for secure communicati…
