Linux Foundation Certified System Administrator (LFCS) — Question 120

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

Answer options

Correct answer: A, D

Explanation

The correct options, A and D, both effectively save changes and exit the vi editor. Option A uses the 'ZZ' command after pressing 'esc' to achieve this, while option D uses the ':wq!' command. Options B, C, and E do not correctly perform both actions of saving and exiting.