Difficulty: Easy
Correct Answer: :w
Explanation:
Introduction / Context:The vi editor in Unix/Linux is one of the most powerful text editors. A core skill is knowing how to save changes without exiting the editor. This helps when you want to preserve your work but continue editing further.
Given Data / Assumptions:
Concept / Approach:
Commands in vi begin with a colon (:) when in command mode. The :w command writes (saves) the file to disk but does not close it, allowing the user to continue editing.
Step-by-Step Solution:
Open vi with vi filename.txt.Make changes in insert mode, then press ESC to return to command mode.Type :w and press Enter.The editor reports “filename written” and remains open for editing.Verification / Alternative check:
Compare :wq which saves and quits. Using only :w leaves you in vi to continue editing.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
:w.
Discussion & Comments