The rm
command refuses to delete the directory by the '.' name. If you instead use the full path name it should delete the directory recursively, i.e. rm -rf `pwd`
.
It is also possible to delete the directory if it is the current directory.
[testuser@testhost] /tmp$ mkdir ff
[testuser@testhost] /tmp$ cd ff
[testuser@testhost] /tmp/ff$ touch a b c
[testuser@testhost] /tmp/ff$ rm -rf ./
rm: cannot remove directory: ‘./’
[testuser@testhost] /tmp/ff$ ls
a b c
[testuser@testhost] /tmp/ff$ rm -rf /tmp/ff
[testuser@testhost] /tmp/ff$ ls
[testuser@testhost] /tmp/ff$ ls ../ff
ls: cannot access ../ff: No such file or directory
[testuser@testhost] /tmp/ff$ cd ..
[testuser@testhost] /tmp$ ls ff
ls: cannot access ff: No such file or directory
From info rm
:
Any attempt to remove a file whose last file name component is .' or
..' is rejected without any prompting.