[Bug 1297147] [NEW] rm -rf . does not delete content of the dir

Hans Ginzel hans at matfyz.cz
Tue Mar 25 09:06:28 UTC 2014


Public bug reported:

Command rm -rf .
writes:
rm: cannot remove directory: ‘.’

That is OK. But it does not delete the content of the dir ‘.’. Command rm -rf * is not the alternative because
1) it does not include hidden files/directories,
2) number of files could exceed max command line length.

Alternative is: find . -delete, but I vote for repairing the rm command.

Commands to reproduce:
mkdir tmp_rm_test
cd tmp_rm_test
echo a>.a
mkdir b
ls -A
rm -rf .
ls -A
find . -delete
ls -A
cd ..
rmdir tmp_rm_test

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: coreutils 8.20-3ubuntu5
ProcVersionSignature: Ubuntu 3.11.0-18.12-lowlatency 3.11.10.4
Uname: Linux 3.11.0-18-lowlatency i686
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: i386
Date: Tue Mar 25 09:57:39 2014
EcryptfsInUse: Yes
MarkForUpload: True
SourcePackage: coreutils
UpgradeStatus: Upgraded to saucy on 2013-10-24 (152 days ago)

** Affects: coreutils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 saucy

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/1297147

Title:
  rm -rf . does not delete content of the dir

Status in “coreutils” package in Ubuntu:
  New

Bug description:
  Command rm -rf .
  writes:
  rm: cannot remove directory: ‘.’

  That is OK. But it does not delete the content of the dir ‘.’. Command rm -rf * is not the alternative because
  1) it does not include hidden files/directories,
  2) number of files could exceed max command line length.

  Alternative is: find . -delete, but I vote for repairing the rm
  command.

  Commands to reproduce:
  mkdir tmp_rm_test
  cd tmp_rm_test
  echo a>.a
  mkdir b
  ls -A
  rm -rf .
  ls -A
  find . -delete
  ls -A
  cd ..
  rmdir tmp_rm_test

  ProblemType: Bug
  DistroRelease: Ubuntu 13.10
  Package: coreutils 8.20-3ubuntu5
  ProcVersionSignature: Ubuntu 3.11.0-18.12-lowlatency 3.11.10.4
  Uname: Linux 3.11.0-18-lowlatency i686
  ApportVersion: 2.12.5-0ubuntu2.2
  Architecture: i386
  Date: Tue Mar 25 09:57:39 2014
  EcryptfsInUse: Yes
  MarkForUpload: True
  SourcePackage: coreutils
  UpgradeStatus: Upgraded to saucy on 2013-10-24 (152 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1297147/+subscriptions



More information about the foundations-bugs mailing list