3 ms·
Almost all of the desktop environments commonly used with Linux do have a trash bin.
by meastham 15y ago
Almost all of the desktop environments commonly used with Linux do have a trash bin.
- cool-RR 15y agoIf it wasn't obvious, "Why is `rm -rf` not connected to the recycle bin?" is implicit in my original question.
- CGamesPlay 15y agoYou're operating at a layer below where a trash can makes sense. Pretend that this command had moved everything to a trash can. The command to move the files out of the trash can now resides in the trash can, where it isn't being very useful. It's still possible to recover the files, but then again, it's also still possible to recover the files you deleted with rm. rm is on the same layer as the DOS del command. Neither goes to the trash can, because they operate on a lower level.
- cool-RR 15y agoit's also still possible to recover the files you deleted with rm. If you're lucky and didn't write too much to the hard-disk after deletion, yes, but with a recycling bin you have much higher chances of recovery. Regarding `del` in DOS: You're the second one to bring up that analogy. I don't see how this is relevant. Just because Windows does it that way doesn't mean that it's good.
- meastham 15y agoBecause that's not what rm does. Changing it would be breaking all sorts of standards. Many, many things depend on rm simply unlinking files. Why don't you use a different program if you would like to have some sort of trashbin behavior?
- cool-RR 15y agoI'd be cool with using a clone of `rm` that sends to the recycling bin instead of actually deleting. I think that Linux should include a clone like this by default.
- cpeterso 15y agoGood question. Here's my 60 second solution. <:) alias rmmmmmmmmmmmmmmmmmmmmmm='rm -i' rm() { D="~/.Trash/`date +%s.%N`"; mkdir -p $D; mv "$@" $D; }
- bricestacey 15y agoIf you want a recycling bin don't use rm, use mv.