rm -rf the directory you are in does not throw and error or remove the directory. Reproducible: Always Steps to Reproduce: 1. rm -rf `pwd` Actual Results: nothing, the directory is not removed, no error is thrown, you are on a new line in your shell Expected Results: an error is thrown or the directory is removed
Works for me: jeroen@astrid ~ $ mkdir test jeroen@astrid ~ $ cd test jeroen@astrid ~/test $ ls -ld drwxr-xr-x 2 jeroen users 4096 Jul 6 01:06 . jeroen@astrid ~/test $ rm -rf . || echo beep rm: cannot remove directory: `.' beep jeroen@astrid ~/test $ rm -rf `pwd` || echo beep jeroen@astrid ~/test $ ls -ld drwxr-xr-x 0 jeroen users 0 Jul 6 01:06 . jeroen@astrid ~/test $ cd - && cd - /home/jeroen bash: cd: /home/jeroen/test: No such file or directory It successfully removes the directory, so it doesn't need to report anything to stdout, and then exits with the satisfaction of a job well done. You then find yourself without solid footing, what with a non-existent CWD and all, so it's the *next* command that is likely to fail, not rm.