If I rm -rf
a folder that has soft links in it, will it try to follow those links and delete the corresponding folder, or will it simply unlink them?
I have a copy of my home directory with symbolic links in it, and I'm scared to rm -rf
it in case it follows those links and blows up the corresponding folders...
Generally speaking, rm
doesn't "delete". It "unlinks". This means that references to a file are removed by rm
. When the number of references reaches zero, the file will no longer be accessible and in time, the area of disk where it resides will be used for something else.
When you rm
a directory, the stuff inside the directory is unlinked. Symbolic links are (sort of like) files with the name of their targets inside them and so they're just removed. To actually figure out what they're pointing to and then unlink the target is special work and so will not be done by a generic tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With