The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove the contents of a file without deleting the file sumesh.abraham Shell Programming and Scripting 10 12-02-2006 02:35 PM
remove the contents of a file surjyap SUN Solaris 2 03-02-2006 01:02 PM
Creating file contents using contents of another file ReV Shell Programming and Scripting 21 02-24-2006 07:25 AM
accidentally remove the contents of /var/sadm/pkg stancwong UNIX for Dummies Questions & Answers 11 01-04-2006 05:25 PM
Remove contents of directory, but not directory pdc Shell Programming and Scripting 8 12-04-2005 10:57 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-04-2008
Registered User
 

Join Date: Aug 2007
Location: Bangalore
Posts: 288
Query:just need to remove the contents of the file without deleting that

Hii,

Please suggest me how can i only remove the contents of the file without deleting it.
Reply With Quote
Forum Sponsor
  #2  
Old 02-04-2008
Registered User
 

Join Date: Oct 2007
Posts: 74
Hi,

The below will delete the contents of the file without deleting the file.

Code:
> filename
Regards,
Chella
Reply With Quote
  #3  
Old 02-04-2008
Registered User
 

Join Date: Jan 2008
Posts: 326
Do you mean you want to make a file zero bytes long?

Edit: looks like Chella has you covered
Reply With Quote
  #4  
Old 02-04-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Please do search

How to empty a file without removing it.

Time taken to search < (always) time taken to post
-- MM's axiom

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0