[GRLUG] Clear the content of a file without deleting it

Raymond McLaughlin driveray at ameritech.net
Thu Dec 29 14:35:30 EST 2005


Justin Denick wrote:
> holy html batman
> 
> I've liked echo  > file_name

But this leaves a one byte file, he wants to completely clear the file, i.e 0 
byte size. (It could conceivably make a difference.) That one byte is a line 
feed, so what you want is
     bash$ echo -n > file_name




> On 12/29/05, Bill Pribble <Bill.Pribble at haworth.com> wrote:
>>
>> #  >  file_name
>>i know there is a command that will clear the content of a file without
>>deleting it, but i can not remember what it is


More information about the grlug mailing list