err....be careful with the dd one


--
Guy Taylor
Obsidian Systems
Cell: 083 357 3438
E-mail: [EMAIL PROTECTED]

Please terminate paranoia() at your favourite recursion level.

PGP PUBLIC KEY BLOCK:
Available at ftp://lava.obsidian.co.za/pub/keys/guyspubkey

                                                                  
                                                                       

On Fri, 7 Jan 2000, Angus Lees wrote:

> On Fri, Jan 07, 2000 at 01:15:52AM +1100, Shrestha wrote:
> > Is there any command under linux to clear the contents of a file.
> > 
> > I don't want to delete the file but I want to delete everything which is
> > inside that file.
> 
> ok, we've already had:
> 
>  cat /dev/null > file
> 
>  sh -c "> file"
> 
> 
> just because i'm bored:
> 
>  echo -n "" > file
> 
>  rm file && touch file
> 
>  dd if=/dev/random of=file count=0
> 
>  echo ,dXw | tr X '\n' | ed file
> 
>  grep -q 7 /dev/random > file
> 
> (and many variants of those ideas)
> 
> 
> note also that any zero size file is the world's smallest
> self-replicating program:
> 
> touch mkempty
> chmod a+x mkempty
> ./mkempty > file
> 
> 
> does that cover it ;)
> 
> -- 
>  - Gus
> --
> SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
> To unsubscribe send email to [EMAIL PROTECTED] with
> unsubscribe in the text
> 

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to