Bird
0
0

You try to save a file in Vim by typing :wq but get an error 'E45: 'readonly' option is set'. What should you do to save and quit?

medium📝 Debug Q6 of 15
Linux CLI - Viewing and Editing Files
You try to save a file in Vim by typing :wq but get an error 'E45: 'readonly' option is set'. What should you do to save and quit?
A:wq!
B:q!
C:w
D:x
Step-by-Step Solution
Solution:
  1. Step 1: Understand readonly error

    The error means the file is readonly; you need to force save.
  2. Step 2: Use force save command

    :wq! forces write and quit despite readonly.
  3. Final Answer:

    :wq! -> Option A
  4. Quick Check:

    Force save readonly file = :wq! [OK]
Quick Trick: Add ! to force save readonly files (:wq!) [OK]
Common Mistakes:
  • Using :q! which quits without saving
  • Using :w which fails on readonly
  • Using :x which may fail on readonly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes