exam questions

Exam LFCS All Questions

View all questions & answers for the LFCS exam

Exam LFCS topic 1 question 62 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 62
Topic #: 1
[All LFCS Questions]

In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple rows?

  • A. By using the command :repeat followed by the number and the command.
  • B. By specifying the number right in front of a command such as 4l or 2yj.
  • C. By selecting all affected lines using the shift and cursor keys before applying the command.
  • D. By issuing a command such as :set repetition=4 which repeats every subsequent command 4 times.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
rona962
2 months, 4 weeks ago
Selected Answer: B
In the vi editor, commands such as moving the cursor or copying lines into the buffer can be issued multiple times or applied to multiple rows by specifying the number right in front of the command. Therefore, the correct option is B. This is known as a repetition factor, and it allows you to execute a command multiple times on a range of lines. For example, you can use 4l to move the cursor four characters to the right, or 2yj to copy the current line and the line below it into the buffer. Note that not all commands can be repeated this way, but many of the basic editing commands in vi support this feature. Additionally, you can combine repetition factors with other commands to perform more complex operations, such as 3dw to delete the next three words.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago