U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation LFCA Exam - Topic 1 Question 31 Discussion

When using vi or vim to edit a file, how do you exit without saving?
C) :wq!
A) :q!
B) ZZ
D) :exit

Linux Foundation LFCA Exam - Topic 1 Question 31 Discussion

Actual exam question for Linux Foundation's LFCA exam
Question #: 31
Topic #: 1
[All LFCA Questions]

When using vi or vim to edit a file, how do you exit without saving?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Jovita
7 months ago
Really? I always thought you could just close the terminal!
upvoted 0 times
...
Dorsey
7 months ago
I thought ZZ would work too, but it saves changes!
upvoted 0 times
...
Josue
7 months ago
Wait, isn't :exit also a valid command?
upvoted 0 times
...
Jennifer
7 months ago
Totally agree, :q! is the way to go!
upvoted 0 times
...
Carissa
8 months ago
It's definitely :q! to exit without saving.
upvoted 0 times
...
Alana
8 months ago
I’m leaning towards :q! as the answer, but I might be mixing it up with another command I practiced.
upvoted 0 times
...
Kenny
8 months ago
I feel like I’ve seen :exit before, but I’m pretty sure that’s not the right command for quitting without saving.
upvoted 0 times
...
Ricarda
8 months ago
I remember practicing this, and I think :wq! is for saving, not exiting without saving.
upvoted 0 times
...
Adelina
8 months ago
I think to exit without saving, it's definitely something like :q!, but I’m not 100% sure.
upvoted 0 times
...
Felice
8 months ago
Ah, the old vi/vim exit without saving trick. It's been a while since I've used it, but I'm pretty sure the answer is A, ":q!". That should do the trick.
upvoted 0 times
...
Nathan
8 months ago
I'm a bit confused by this question. I don't use vi/vim very often, so I can't remember the exact command for exiting without saving. I'll have to guess on this one.
upvoted 0 times
...
Dominga
8 months ago
Okay, I've got this. The way to exit vi/vim without saving is to use the ":q!" command. It's a classic vi/vim trick that I've used many times.
upvoted 0 times
...
Benton
8 months ago
Hmm, I'm a bit unsure about this one. I know there are different ways to exit vi/vim, but I can't remember the exact command for exiting without saving. I'll have to think about this one.
upvoted 0 times
...
Wenona
9 months ago
I'm pretty sure the answer is A. I've used vi/vim before and ":q!" is the command to exit without saving.
upvoted 0 times
...
Rebbecca
9 months ago
Hmm, I think it has to do with flexible channel spacing, but I'm not 100% confident. I'll try to remember the key points about Flexgrid and see if that helps me narrow down the answer.
upvoted 0 times
...
Geraldine
1 year ago
Wait, you can exit vi without saving? Whoa, mind blown! :q! is the one, I'm remembering that for the next time I accidentally launch vi and panic.
upvoted 0 times
Jettie
1 year ago
It's a lifesaver when you accidentally open vi and need to get out quickly!
upvoted 0 times
...
Burma
1 year ago
I always forget the command too, but :q! is definitely the one to remember.
upvoted 0 times
...
Miesha
1 year ago
Yeah, :q! is the way to go if you want to exit without saving.
upvoted 0 times
...
...
Ronny
1 year ago
C) :wq! would save the file before exiting, which is the opposite of what I want. :q! is the way to go here.
upvoted 0 times
Gussie
1 year ago
A) :q!
upvoted 0 times
...
Lashaunda
1 year ago
B) ZZ
upvoted 0 times
...
Chu
1 year ago
A) :q!
upvoted 0 times
...
...
Crista
1 year ago
D) :exit sounds like it could work, but I'm not sure if that's a valid command in vi/vim. Better stick with the classic :q! just to be safe.
upvoted 0 times
Tamra
12 months ago
C) :wq! is another good option to exit and save the changes.
upvoted 0 times
...
Noe
12 months ago
A) Yeah, better safe than sorry with :q!.
upvoted 0 times
...
Jeffrey
12 months ago
B) ZZ is also a valid command to exit without saving.
upvoted 0 times
...
Cherelle
12 months ago
A) :q! sounds like the safest option.
upvoted 0 times
...
Luisa
12 months ago
D) :exit
upvoted 0 times
...
Colette
1 year ago
C) :wq!
upvoted 0 times
...
Junita
1 year ago
B) ZZ
upvoted 0 times
...
Noah
1 year ago
A) :q!
upvoted 0 times
...
...
Steffanie
1 year ago
But :q! is the command to quit without saving in vi or vim
upvoted 0 times
...
Nikita
1 year ago
B) ZZ seems like it might work, but I'm pretty sure that's for saving and exiting, not just exiting without saving. I'm going with A) :q!.
upvoted 0 times
Zachary
1 year ago
B) Yeah, you're right. ZZ is for saving and exiting. :q! is the one for just exiting.
upvoted 0 times
...
Chauncey
1 year ago
A) :q! is the correct command to exit without saving in vi or vim.
upvoted 0 times
...
...
Jamal
1 year ago
I disagree, I believe the correct answer is B) ZZ
upvoted 0 times
...
Daniel
1 year ago
The :q! command is definitely the way to exit without saving in vi or vim. I always use that when I accidentally make changes I don't want to keep.
upvoted 0 times
Pamella
1 year ago
No problem, happy to help!
upvoted 0 times
...
Leila
1 year ago
I always forget the command, thanks for the reminder.
upvoted 0 times
...
William
1 year ago
Yeah, it's a lifesaver when you make a mistake.
upvoted 0 times
...
Tomoko
1 year ago
I agree, :q! is the way to go.
upvoted 0 times
...
...
Steffanie
1 year ago
I think the answer is A) :q!
upvoted 0 times
...

Save Cancel