From owner-freebsd-questions@freebsd.org Sun Feb 23 22:22:25 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50BC124A9C9 for ; Sun, 23 Feb 2020 22:22:25 +0000 (UTC) (envelope-from bob@proulx.com) Received: from havoc.proulx.com (havoc.proulx.com [96.88.95.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48Qfnq6wDDz3Gl7 for ; Sun, 23 Feb 2020 22:22:23 +0000 (UTC) (envelope-from bob@proulx.com) Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id AA06D441 for ; Sun, 23 Feb 2020 15:22:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proulx.com; s=dkim2048; t=1582496541; bh=7s3tS5p1lCZ3XS5jR3yDhftBUyJzLW3GxPFfE2s4NNQ=; h=Date:From:To:Subject:References:In-Reply-To:From; b=bLfMAxvEP8e/leFtWFDgYCUQQCFhVKXP0NxwWjXnc0c/HPXrAxnfman9hM7js+Uwz qSe8kJVB6t+AZGwezPVIftCWT3xzLDTWPp9ts0p568q/nQR5MxmyAfWwaTu80HUd0o Agi7uJB1eJwQq5ipHGjcXXvqpFV4C2+PTZIw4xUDZroUNexbEErIpKASI1AV1CaKXb ySntAJelz7IwxRFxU54+3iHp1h4GSn/Ae9isgS4fr7Re5EMHN9Yx9sAdketF1nnbwy xKsL6iB9kU8+mhjcasdGTZAowWDyeSzRz2fUo20amHkA/v3rFIUsKHtbPbppYJ6cZ5 gPRk9Mbvfty9A== Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 7BBAE21144 for ; Sun, 23 Feb 2020 15:22:21 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 6329B2DC87; Sun, 23 Feb 2020 15:22:21 -0700 (MST) Date: Sun, 23 Feb 2020 15:22:21 -0700 From: Bob Proulx To: freebsd-questions@freebsd.org Subject: Re: rm | Cleaning up recycle bin Message-ID: <20200223151207928780007@bob.proulx.com> References: <5E527E71.2080904@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5E527E71.2080904@gmail.com> X-Rspamd-Queue-Id: 48Qfnq6wDDz3Gl7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=proulx.com header.s=dkim2048 header.b=bLfMAxvE; dmarc=none; spf=pass (mx1.freebsd.org: domain of bob@proulx.com designates 96.88.95.61 as permitted sender) smtp.mailfrom=bob@proulx.com X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[proulx.com:s=dkim2048]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[proulx.com]; DKIM_TRACE(0.00)[proulx.com:+]; RCVD_IN_DNSWL_NONE(0.00)[61.95.88.96.list.dnswl.org : 127.0.10.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7922, ipnet:96.64.0.0/11, country:US]; IP_SCORE(-0.53)[ipnet: 96.64.0.0/11(-1.96), asn: 7922(-0.66), country: US(-0.05)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2020 22:22:25 -0000 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