Is file manager "Send to trash" more permissive than "rm"?
by l0f4r0 from LinuxQuestions.org on (#4ZDGS)
Hi,
There is a useful directory test I don't want to be able to delete as a simple user because as it is in my ~/Downloads directory I could decide to swipe all in there regularly and swipe it along too... (NB: move test elsewhere is not conceivable here)
The easiest way I found to achieve that is to create a .protected file inside ~/Downloads/test whith the immutable flag (chattr +i).
So I'm still able to create files in it, modify or delete them but I won't be able to rename or delete the directory itself.
rm -rf ~/Downloads/test is not allowed, great, but I can still send ~/Downloads/test to trash via my GUI file manager (Thunar). I can even empty the trash afterwards...
Why? How to prevent deletion by GUI as well please?
Thanks in advance :)


There is a useful directory test I don't want to be able to delete as a simple user because as it is in my ~/Downloads directory I could decide to swipe all in there regularly and swipe it along too... (NB: move test elsewhere is not conceivable here)
The easiest way I found to achieve that is to create a .protected file inside ~/Downloads/test whith the immutable flag (chattr +i).
So I'm still able to create files in it, modify or delete them but I won't be able to rename or delete the directory itself.
rm -rf ~/Downloads/test is not allowed, great, but I can still send ~/Downloads/test to trash via my GUI file manager (Thunar). I can even empty the trash afterwards...
Why? How to prevent deletion by GUI as well please?
Thanks in advance :)