In the vi editor, what vi command will copy (but not paste) from the current line at the cursor and the following 16 lines (17 lines total)? Specify the correct vi command without spaces.
Correct Answer:
17yy
Explanation
The vi editor is a text editor that operates in two modes: command mode and insert mode. In command mode, the user can enter commands to perform various operations on the text, such as copying, pasting, deleting, moving, searching, etc. In insert mode, the user can type text into the file. To switch from command mode to insert mode, the user can press i, a, o, or other keys. To switch from insert mode to command mode, the user can press Esc. The yy command is used to copy (yank) the current line into a buffer. The number before the yy command specifies how many lines to copy, starting from the current line. Therefore, the command 17yy will copy the current line and the following 16 lines (17 lines total) into a buffer. The buffer can then be pasted into another location by using the p or P command. Note that the command 17yy does not paste the copied lines, it only copies them. References:
* LPI 101-500 Exam Objectives, Topic 103.8, Weight 4
* LPI Learning Materials, Chapter 3.8, Advanced Scripting
* Web Search Results, 1