Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Feb 2020 15:22:21 -0700
From:      Bob Proulx <bob@proulx.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: rm | Cleaning up recycle bin
Message-ID:  <20200223151207928780007@bob.proulx.com>
In-Reply-To: <5E527E71.2080904@gmail.com>
References:  <a589bf69-a53b-a732-08ff-74e09b723bbd@cloudzeeland.nl> <5E527E71.2080904@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ernie Luzar wrote:
> Jos Chrispijn wrote:
> > I read somewhere that using the rm command does not phsyically remove
> > the 'deleted' files when using the command in a terminal session. Can
> > you tell me how/where I can really remove these files (as per user
> > account or in general)? Thanks!
> 
> To write zeros to existing file before removing that file
> 
> dd if=/dev/zero of=/path/filename bs=1m ; rm /path/filename

The above dd command has no count/size limitation.  It will run
copying zeros into filename until the write fails, typically at a full
disk.  It will fill the disk and then exit.  Then the rm will happen
freeing up the data.  The result is a disk usage spike up and then down.

I expect that was not what was intended.  I expect the intention was
that it would overwrite the file.  But that is not what happens with
the above and therefore I would not recommend the above.  At the least
conv=notrunc would be needed or dd truncates the file before writing.

Bob



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