PrepAway - Latest Free Exam Questions & Answers

In the vi editor, which of the following commands will delete the current line at the cursor and the 16 lines

In the vi editor, which of the following commands will delete the current line at the cursor and the
16 lines following it (17 lines total)?

PrepAway - Latest Free Exam Questions & Answers

A.
17d

B.
17dd

C.
17x

D.
d17d

E.
16d

Explanation/Reference:
Alternative: Answer B or D ist correct!

17x just deletes 17 characters
17d or 16d is waiting for additional command input (besides 16dd would delete only 16 lines)

One Comment on “In the vi editor, which of the following commands will delete the current line at the cursor and the 16 lines

  1. nwildner says:

    dd is somehow a “shortcut” do “Delete a Line”, so, thats why you can use the 2dd form. A good way to memorize vim commands is: Action + Quantity + Object

    Delete 2 words = d2w
    Delete 2 paragraphs(see the concept of paragraph on vim) = d2}

    Anywhere in the documment, create a mark caller b = mb
    Somewhere up this mark, delete until it reaches this mark(including the line): d’b




    0



    0

Leave a Reply