nerdexam
Linux_Foundation

LFCS · Question #809

In the vi editor, which of the following commands will copy the current line into the vi buffer?

The correct answer is D. yy. This question tests knowledge of basic line manipulation commands within the vi text editor, specifically for copying a line.

Submitted by carlos_mx· Apr 18, 2026Essential Commands

Question

In the vi editor, which of the following commands will copy the current line into the vi buffer?

Options

  • Ac
  • Bcc
  • C1c
  • Dyy
  • E1y

How the community answered

(31 responses)
  • B
    3% (1)
  • D
    90% (28)
  • E
    6% (2)

Why each option

This question tests knowledge of basic line manipulation commands within the `vi` text editor, specifically for copying a line.

Ac

`c` (change) is a command to change characters, requiring a motion command, and puts `vi` into insert mode after deleting.

Bcc

`cc` (change line) cuts the current line and immediately puts `vi` into insert mode, deleting the line's content rather than just copying it.

C1c

`1c` is not a standard `vi` command for copying a line; it would initiate a change operation on one character.

DyyCorrect

In `vi`'s normal mode, the `yy` command (yank current line) copies the entire current line into the unnamed buffer. This allows the line to be pasted elsewhere using the `p` or `P` command.

E1y

`1y` is not the standard `vi` command for yanking the current line; `yy` is the correct two-character command for this action.

Concept tested: vi editor line copying (yanking)

Source: https://www.freebsd.org/cgi/man.cgi?query=vi&sektion=1

Topics

#vi editor#text manipulation#copy command#yy command

Community Discussion

No community discussion yet for this question.

Full LFCS Practice