I know that the trashcan on Ubunutu Mate desktop performs a simple delete process, where one could theoretically recover the files after deletion. Is there an option to change that default functionality, and opt for using shred, or a shred like command to permanently delete files?
The simplest way to achieve this would probably be to watch the trash location (
~/.local/share/Trash/Files
I believe) for files, and use inotifywait to shred files when they arrive.inotifywait
can be installed withsudo apt-get install inotify-tools
This snippet will shred any files as they appear in the trash folder. In addition you can use
gvfs-trash --empty
to empty the trash once the shred is complete, or you can askshred
to remove the file after overwriting, withshred -u
.(This answer was largely based on https://unix.stackexchange.com/questions/24952/script-to-monitor-folder-for-new-files and How do I get the filename from inotifywait events? which may provide some additional information)