I have tried to follow the following:
How to delete selected text in VI editor
but
5dd
gives
E492: Not a
To delete all the lines use - ESC gg dG To delete few lines lets say 5 then use ESC 5dd