Hacker News new | ask | show | jobs
by meastham 5487 days ago
Almost all of the desktop environments commonly used with Linux do have a trash bin.
1 comments

If it wasn't obvious, "Why is `rm -rf` not connected to the recycle bin?" is implicit in my original question.
You'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.

it'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.

If you want a recycling bin don't use rm, use mv.
Because 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?
I'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.
Good question. Here's my 60 second solution. <:)

  alias rmmmmmmmmmmmmmmmmmmmmmm='rm -i'
  rm() { D="~/.Trash/`date +%s.%N`"; mkdir -p $D; mv "$@" $D; }