HOWTO : Bulk deletes in vi

Use “dG” command, if you want to delete all lines in a file starting from the line under the cursor in vi.

Additional commands to delete lines

  1. dd deletes the whole line under the cursor.
  2. xdd deletes multiple (x) lines, starting at the cursor. For example 10dd deletes 10 lines
  3. d$ deletes to the end of the line, starting at the cursor.