Bird
0
0

You open a file in Vim, press i to insert text, type "Hello", then press Esc and enter :wq. What happens?

medium📝 Command Output Q13 of 15
Linux CLI - Viewing and Editing Files
You open a file in Vim, press i to insert text, type "Hello", then press Esc and enter :wq. What happens?
AThe text "Hello" is saved and Vim quits
BThe text "Hello" is discarded and Vim quits
CVim saves but stays open
DVim quits without saving
Step-by-Step Solution
Solution:
  1. Step 1: Insert and exit insert mode

    Pressing i enters insert mode, typing "Hello" adds text, pressing Esc returns to command mode.
  2. Step 2: Use :wq command

    :wq saves the file and quits Vim.
  3. Final Answer:

    The text "Hello" is saved and Vim quits -> Option A
  4. Quick Check:

    :wq saves and quits [OK]
Quick Trick: Use :wq to save and exit Vim [OK]
Common Mistakes:
MISTAKES
  • Forgetting to press Esc before :wq
  • Using :q without saving
  • Expecting :wq to only save

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes