LPIC-1 Exam 101, Part 1 of 2, version 5.0 101-500 Question # 63 Topic 7 Discussion
101-500 Exam Topic 7 Question 63 Discussion:
Question #: 63
Topic #: 7
While editing a file in vi, the file changes due to another process. Without exiting vi, how can the file be reopened for editing with the new content?
The :e command in vi is used to edit a file. If the file name is not specified, it will edit the current file. If the file has been changed by another process, the :e command will reload the file with the new content, discarding any unsaved changes made in vi. Therefore, the :e command can be used to reopen the file for editing with the new content without exiting vi. The other options are either invalid or do not perform the desired task. The :r command is used to read the content of another file or command and insert it into the current file. The :n command is used to edit the next file in the argument list, if any. The :w command is used to write the current file to disk, optionally with a new name. References:
LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.7 Use and edit text files
LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit