in the days of yore, when i still was a green linux/unix newbie i attempted to use the mirror tool (written in perl i believe) to create a mirror of something on my account. i configured the tool to write the files into a directory in my home. in the config i wrote ~/somewhere ...
after running the tool, i discovered a literal directory named "~".
that's wrong i thought, fixed the config and proceded to remove the offending directory:
rm -r ~
then i waited ...
and waited ...
and i started wondering why removing an almost empty directory is so slow ...
...
...
oh sh!!!!!!
...
i have no recollection of what i lost that day, but i learned a few lessons:
prefix ambiguous paths with ./
rm -r ./~ would have worked.
don't use rm -r when you can avoid it.
rmdir -p ~/something would have failed without causing damage.
rmdir -p ./~/something would have been the best option.
if there are files but no subdirs inside then
is my preference now.