GNU bug report logs - #12339
Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Mon, 3 Sep 2012 00:34:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bob Proulx <bob <at> proulx.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 12339 <at> debbugs.gnu.org
Subject: bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.
Date: Sun, 2 Sep 2012 21:53:52 -0600
Linda Walsh wrote:
> Now there seems to be a special check for "." and disallow it as a
> rm target.  But that was a safe and portable way to delete all contents.
> ...
> I would expect it to delete all but the current inode I'm parked on, and
> for it -- either issue an error or silently ignore ... preferring 'DoWIMean'
> versus 'technically'...as being more user friendly.
> 
> Sides -- it normally does depth-first traversal --- since you can't delete
> a dir with contents still in it -- so why different for '.'?

+1.  Feels like a bug to me.

Workaround:

  find . -delete

Bob




This bug report was last modified 6 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.