How can I delete multiple lines in vi?

vi
deltanovember picture deltanovember · Apr 9, 2013 · Viewed 310.4k times · Source

I have tried to follow the following:

How to delete selected text in VI editor

but

5dd

gives

E492: Not an editor command: 5dd

I then tried:

5d

Which only deletes a single line. How can I delete multiple lines?

Answer

KCD picture KCD · Oct 1, 2013

I find this easier

  1. Go VISUAL mode Shift+v
  2. Select lines
  3. d to delete

https://superuser.com/questions/170795/how-can-i-select-and-delete-lines-of-text-in-vi