1

I would like to empty the system trash the proper way (ie not just rm -rf) and for this I wanted to use glib2, which provides a command called gio trash which can be used to interact with the trash. However when I want to list files found in the trash, I get the message

> sudo gio trash --list                        [11:22:55]
gio: trash:: Operation not supported

deleting all trashed files using gio trash --empty does not display any output, returns 0 but does not delete any files in the trash.

2 Answers2

0

Not a gio answer but install the python module trash-cli, then use the trash-empty command to empty the trash.

0

It always says that, because the gio tools do not work through sudo. If you're trying to use sudo because you've been having permissions problems otherwise, then you need to fix those permissions problems instead of using sudo.

Make sure your ~/.local/share/Trash/ as well as its 'info' and 'files' subdirectories are owned by yourself, not by root. chown -R them if necessary.

chown -Rhc $USER: ~/.local/share/Trash
grawity
  • 501,077