Skip to main content

New answers tagged

1 vote

Why can't I use `rm -r` on a symlink pointing to a directory?

It's opinion based, but I think the most obvious reason why is safety and consistency. The intended purpose of rm -r is to delete a directory. That named directory. But if you had a directory tree ...
Philip Couling's user avatar
3 votes

Why can't I use `rm -r` on a symlink pointing to a directory?

so if I want to remove a symlink I need to rm symlink without the trailing / correct, because with a trailing slash like in your rm -r symlink/ example that is telling rm explicitly that the name ...
ron's user avatar
  • 9,092
5 votes

Why can't I use `rm -r` on a symlink pointing to a directory?

It wouldn't be consistent, plain as that, and you even spell that out: rm symlink_to_file deletes the symlink to the file, not the file itself rm -r directory_containing_symlinks_to_files deletes the ...
Marcus Müller's user avatar

Top 50 recent answers are included