I've used gvfs-trash to move an item to trash from a command-line. Is there a way to restore such a file from the command-line? I've checked other gvfs binaries and don't see one that makes sense?

I know there are other projects out there that are devoted to implementing the Freedesktop.org Trash spec. I'm interested a gvfs approach.


In the gvfs-bin package, there is currently no restore counterpart to gvfs-trash, so the only way around it at the moment is to install trash-cli from the repositories (more information here) and use the trash-restore (restore-trash in 18.10 and earlier releases) function from there after sending a file to trash with gvfs-trash. They are both compatible as they adhere to the freedesktop trash specification, as you probably know.

To send a file to trash, enter:

gvfs-trash newt

Then run


which gives the prompt

0 2012-09-13 01:09:05 /home/mike/newt
What file to restore [0..0]: 0

This seems to be the way to restore things sent to trash from the command-line at the moment, but it will be worth updating the answer in the future if a gvfs restore tool appears to compliment gvfs-trash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.