0

How to Delete the whole text file Content using vim Shortcuts On CentOS 7.6

Hello.

I just wanted to delete the content of a file from first line to last line using vim editor On centos 7.6.Is there any way to do this

Thanks

carter
asked Dec 13, 2019
1 Answer
0
  • Open the text file using vim editor
  • Press Esc key to be in command mode
  • Enter gg so that the cursor moves to the first line of the file
  • Now enter dG whuch deletes the content till last line of the file

This is how clear the whole text content of a file using a Vim Editor

View More
linuxhelp
answered Dec 13, 2019
Your Answer
||||
 
100:0