Up until now I was using Ubuntu, and the behaviour of rm for directories was the following:
rm -r dirwould removedirif it was empty, and give an error otherwiserm -rf dirwould removedirand its contents recursively
It's possible that rm was aliased to something to behave this way, but I no longer have access to my Ubuntu system so I can't tell.
Now I switched to Linux Mint, and the behaviour is different: rm -r removes a directory and its contents recursively, just like rm -rf did on Ubuntu.
I looked at rm's manpage on Linux Mint to try to find a combination of options that would reproduce the Ubuntu behaviour, but I couldn't find any.
My questions are:
- Why is the behaviour of
rmdifferent between Linux distributions? Isn't it a standard tool that should be the same everywhere? - How do I achieve the behaviour described at the beginning of the question?