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)?

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)?

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)?

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)



Leave a Reply 1

Your email address will not be published. Required fields are marked *


nwildner

nwildner

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