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
- dd deletes the whole line under the cursor.
- xdd deletes multiple (x) lines, starting at the cursor. For example 10dd deletes 10 lines
- d$ deletes to the end of the line, starting at the cursor.