LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to delete entire contents of file using vi editor once (https://www.linuxquestions.org/questions/linux-general-1/how-to-delete-entire-contents-of-file-using-vi-editor-once-577742/)

sunlinux 08-17-2007 05:24 AM

how to delete entire contents of file using vi editor once
 
how to delete entire contents of file using vi editor once ?

indeliblestamp 08-17-2007 05:48 AM

If you're in the first line of the file, use dG

If you're anywhere in the file, use :1,$d


All times are GMT -5. The time now is 07:14 PM.