New answers tagged rm
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 ...
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 ...
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 ...
Top 50 recent answers are included
Related Tags
rm × 849files × 149
bash × 134
linux × 132
find × 123
directory × 103
shell × 82
permissions × 67
shell-script × 60
command-line × 60
filenames × 38
wildcards × 34
macos × 34
delete × 33
filesystems × 29
data-recovery × 24
symlink × 22
ubuntu × 21
date × 19
recursive × 19
grep × 18
mv × 15
ls × 14
xargs × 13
command × 12