If I run the following sequence of commands:
mkdir dir ln -s dir link rm -r link/
I get this output:
rm: cannot remove `link': Not a directory
I get the warning because I could simply have issued
rm -r link or, better still,
rm link. Regardless, that command did get the job done (i.e. removed the file named "link").
Things are a bit different when doing such a thing on a mounted volume, where "dir" is replaced with some like "/media/my_movies". In such a case, the entire volume will be wiped, not just the symlink as in the previous example.
Why is it like that? Is this some bug in
rm, or is this expected? Why the inconsistency?
UPDATE: Maybe I was dizzy when I was experiencing this because when I try now, "dir" is not getting deleted while its contents are, and in both cases (mounted and local directory). I'm using Linux 2.6.32, and I think I was using 2.6.37 then.