LFCS Exam QuestionsBrowse all questions from this exam

LFCS Exam - Question 73


Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose TWO correct answers.)

Show Answer
Correct Answer: A,D

In the vi editor, 'esc ZZ' is a sequence that saves the opened document and exits the editor. Similarly, 'esc :wq!' also saves the document and exits the editor, with the '!' ensuring that the write is forced even if there are warnings.

Discussion

1 comment
Sign in to comment
9866666Options: AD
Jun 25, 2024

he correct answers are: A. esc ZZ - This is a common shortcut to save the current file and exit vi. D. esc :wq! - This is the command mode version of saving and quitting, with the '!' forcing the write even if there are potential warnings. Here's why the other options are incorrect: B. ctrl :w! - The control key (ctrl) is not typically used with the colon command in vi. C. esc zz - There is no 'zz' command in vi. E. ctrl XX - The control key (ctrl) is not typically used for exiting vi.