Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2003 16:39:42 -0500
From:      parv <parv_fm@emailgroups.net>
To:        Jan Grant <Jan.Grant@bristol.ac.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: cleaning out files
Message-ID:  <20030404213942.GA20042@moo.holy.cow>
In-Reply-To: <Pine.GSO.4.44.0304041536440.14291-100000@mail.ilrt.bris.ac.uk>
References:  <200304041227.46615.a.carter@intrasoft.lu> <Pine.GSO.4.44.0304041536440.14291-100000@mail.ilrt.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
in message
<Pine.GSO.4.44.0304041536440.14291-100000@mail.ilrt.bris.ac.uk>,
wrote Jan Grant thusly...
>
> On Fri, 4 Apr 2003, CARTER Anthony wrote:
> 
> > How do I clean the contents of text files without actually
> > removing the files?
> 
> man 1 truncate
> 
> This is a command-line utility that directly wraps the appropriate
> system call.

Some other ways are (bourne shell)...

  cat /dev/null > file
  > file

...w/ above three methods, you would/should not have problem w/
binary files too, unlike the "echo -n" method.


  - parv

-- 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030404213942.GA20042>