install trash-cli by default in Whonix 14?

Instructions such as…

rm -r ~/.thunderbird

Are a bit dangerous. If the user adds a space between the slash / and the dot ., the user wipes its whole home folder.

If we had the trash-cli package installed by default, we could suggest instead.

trash-put ~/.thunderbird

Should we install trash-cli by default in Whonix 14 so Whonix wiki could be ported to using trash-put rather than rm?

Hi Patrick!

I have been thinking about this proposal for a while, and the following some of my thought:

  1. It seems that this is not a Whonix specific problem. Every Unix related tutorial online may suffer from this potential risk.
  2. It seems to violate the “rule of least surprise” introduced in the art of Unix programming? Specifically,

“[t]he easiest programs to use are those that demand the least new learning from the user or, to put it another way, the easiest programs to use are those that most effectively connect to the user’s pre-existing knowledge”.

For user who is familiar with Unix operating system, but not Whonix, this trash-cli may be another thing need to learn before using Whonix, which increase the learning curve?

  1. trash-cli != rm According to the Github page of trash-cli:

“Although the interface of trash-put seems to be compatible with rm, it has different semantics which will cause you problems. For example, while rm requires -R for deleting directories trash-put does not.”

User who does not read the trash-cli manual carefully and assume they are the same thing may make some mistakes?

However, this is still a valid point:

So maybe we can document trash-cli somewhere in the Whonix Wiki and leave the choice of using it or rm to users? We may also put a warning template before every command line including rm, saying:

Using rm without cautious can be dangerous, it is suggested to copy and paste the following command line instead of typing it yourself. Or you may find trash-cli useful + link to trash-cli?

These are all my personal thought, I am too afraid to say what is the right thing to do in front of all the Unix gurus. I am open and looking forward to the discussions. :slight_smile:


Hi Patrick and iry

Would using safe-rm be a possible solution?

It could come preconfigured with Whonix and users would not have to learn how to use a new command. The hardest part would be deciding which files/directories should be protected. / is an obvious one. :grin:

1 Like