cleaning out files

parv parv_fm at emailgroups.net
Fri Apr 4 13:36:50 PST 2003


in message
<Pine.GSO.4.44.0304041536440.14291-100000 at 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

-- 



More information about the freebsd-questions mailing list