Re: deleting files with linux

From: L Ekman (emil71se@yahoo.com)
Date: 04/22/03


From: "L Ekman" <emil71se@yahoo.com>
Date: Tue, 22 Apr 2003 17:04:25 GMT

Chris Lowth <please@no.spam> wrote:
>>> ls -l <filename> #to get the length of the file
>>> dd if=/dev/zero of=<filename> count=<length> #to write zero's
>>> dd if=/dev/urandom of=<filename> count=<length> #to write random data
>>> bytes rm <filename>

> Nope - wont work (well - may not work) because dd truncates and re-allocates
> the file space, which can wind up moving it (or bits of it).

Yes, but that can be avoided with "conv=notrunc", like;

  dd if=/dev/zero of=<filename> count=<length> conv=notrunc
                                               ~~~~~~~~~~~~

> Keep it simple - use the "shred" utility which is specifically designed to
> do what the OP is after (ie: "in-place" zapping of the file).

Probably a good advice in any case.

Regards,
L Ekman



Relevant Pages

  • Simple but revolutionary math question
    ... - Sailboats can sail close to the wind. ... So this means we have 20 mph combined drag moving at 10 mph up against ...
    (sci.math)
  • Re: SIDs Not Resolving
    ... reset the secure channel with netdom.exe. ... Regards, ... Jimmy Andersson, Q Advice AB ... Admins') to the local admin account on some of the XP boxes. ...
    (microsoft.public.windows.server.active_directory)
  • RE: Question on chat message
    ... Regards ... How to add two chat server names. ... > Can some one advice me ... E-mail transmission cannot be guaranteed to be secure or error-free ...
    (perl.beginners)
  • Re: Relativity is a Dutch discovery
    ... moving - that is what is meant by 'wind'. ... stationary in a frame and is independent of if the aether is a material ... probe for gravito-inertial fields. ...
    (sci.physics.relativity)
  • Re: Add new users
    ... Regards, ... Jimmy Andersson, Q Advice AB ... Microsoft MVP - Directory Services ...
    (microsoft.public.win2000.active_directory)