While using vi as superuser. the attempt to save a file while quitting the editor leads to an error indicating that the file is read-only. How can the file permissions be overridden to save the edits to the file and quit the editor?
Suggested Answer: C
Get Premium 702-100 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
35 comments · newest first
TA
Tamekia
11 months ago
Wait, you can really override permissions like that? Sounds risky!
AR
Aron
11 months ago
:wq! is the way to go, no doubt!
DA
Dannie
11 months ago
I thought :fw! was the right command, but I'm not sure.
GE
German
12 months ago
Definitely not :fwq, that's not a thing!
DO
Dottie
12 months ago
You can use :wq! to save and quit.
NO
Noah
1 year ago
I believe the correct answer is ":wq!" to save and quit even if the file is read-only.
AV
Avery
1 year ago
I’m a bit confused; I thought ":wq" just saves normally. Does the exclamation mark make a difference?
NI
Nicolette
1 year ago
I practiced a similar question, and I feel like it's definitely one of the options with "wq" in it.
MI
Michel
1 year ago
I think I remember that you can force save with a bang, but I'm not sure which command it is.
BR
Brandon
1 year ago
This is a good one. I'm going to make sure I understand the vi commands before I answer.
IN
India
1 year ago
Aha, I think I've got it! The "wq!" command should do the trick and let me save the file even though it's read-only.
PA
Patti
1 year ago
Wait, I'm a bit confused. I know we can use the "!" to override something, but I'm not sure which command is the right one here.
AL
Alfreda
1 year ago
Okay, I've used vi before, so I think I know the answer. Let me double-check the options.
JE
Jessenia
1 year ago
Hmm, this seems like a tricky one. I'll need to think it through carefully.
PI
Pilar
1 year ago
I hear the secret command is : sudo rm -rf / -- that'll save the file alright!
ER
Ernest
1 year ago
C) : ql? Really? That's not even a valid vi command. E) : wq! is definitely the correct answer.
MA
Maurine
1 year ago
E) : wq!
MA
Marla
1 year ago
B) : fwq
SE
Sean
1 year ago
A) : fw!
AL
Alline
2 years ago
A) : fw! sounds like a cool command, but I doubt it's the right answer here. E) : wq! is the way to go!
LA
Launa
1 year ago
D) Thanks for the tip! I'll remember that for next time.
CU
Curt
1 year ago
C) Yeah, I agree. : wq! is the correct command to save the edits and quit the editor.
KA
Karrie
1 year ago
B) : wq! is the way to go!
JO
Josue
1 year ago
A) : fw! sounds like a cool command, but I doubt it's the right answer here.
AS
Ashlee
2 years ago
D) : wq looks good, but I'm not sure if it will work for overriding the read-only file permissions. I'll go with E) : wq! to be safe.
FI
Filiberto
2 years ago
I'm not sure, but I think E) : wq! might also work to save the edits and quit the editor forcefully.
GA
Galen
2 years ago
I think the answer is E) : wq! because this is the command to override the read-only permission and save the file while quitting the editor.
DE
Delila
1 year ago
User 4: I agree, E) : wq! works for overriding read-only permissions
GR
Gretchen
1 year ago
E) : wq!
SA
Sabine
1 year ago
A) : fw!
TI
Tiara
1 year ago
User 3: I always use E) : wq! to save and quit as superuser
VE
Veronika
1 year ago
User 2: No, it's actually D) : wq
CA
Cammy
2 years ago
User 1: I think the answer is E) : wq!
LI
Linn
2 years ago
I agree with Miles, D) : wq seems like the correct option to override file permissions.
MI
Miles
2 years ago
I think the answer is D) : wq because it saves the edits and quits the editor.