> For Linux gurus out there: How do I clear the contents of a file without
> erasing it? Is there a Linux command that will do this for me in one
> step? I don't want to erase the file, just zero its contents, without
> changing ownership and permissions.
>
> Thanks in advance,
How about this:
dd if=filename of=filename ibs=1
This reads one byte from the file and then outputs it to the same file ...
you end up with an empty file. If you end up putting it into a script you
might want to redirect the output to /dev/null or something.
Keith Brown
University of Saskatchewan
Saskatoon, Saskatchewan
-----------------------------------------------------------------------
The gates in my computer are AND, OR and NOT; they are not Bill.
-----------------------------------------------------------------------
Received on Mon Dec 19 2005 - 09:55:54 MST