Linux Foundation Certified System Administrator (LFCS) — Question 123
What happens after issuing the command vi without any additional parameters?
Answer options
- A. vi starts and loads the last file used and moves the cursor to the position where vi was when it last exited.
- B. vi starts and requires the user to explicitly either create a new or load an existing file.
- C. vi exits with an error message as it cannot be invoked without a file name to operate on.
- D. vi starts in command mode and opens a new empty file.
- E. vi starts and opens a new file which is filled with the content of the vi buffer if the buffer contains text.
Correct answer: D
Explanation
The correct answer is D because when vi is started without any parameters, it defaults to opening a new empty file in command mode. Options A, B, and E are incorrect as they describe behaviors that do not occur when no file is specified, and option C is also wrong because vi does not exit with an error in this scenario.