When using the vim editor, sometimes a file is edited, and the content of the file is relatively large. If you need to quickly clear the entire file, you can use the following command: In command mode, first execute gg Here is to jump to the first line of the file and then execute: dG This clears the entire file!
Another way is to quit VIM, and then use echo >> file, which can also quickly empty the file content.