LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-17-2007, 06:24 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 226

Rep: Reputation: 30
how to delete entire contents of file using vi editor once


how to delete entire contents of file using vi editor once ?
 
Old 08-17-2007, 06:48 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
If you're in the first line of the file, use dG

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chown, chgrp an entire directoy and contents gin1 Red Hat 8 09-06-2013 03:48 AM
how to delete the file contents using shell scripts sharad Linux - Software 3 05-26-2006 12:44 PM
how to delete the contents of a file using shell scripts sharad Linux - Software 5 05-22-2006 06:22 AM
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 07:47 AM


All times are GMT -5. The time now is 02:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration