Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Trash spec. I'm interested a gvfs approach.

share|improve this question
up vote 4 down vote accepted

In the gvfs-bin package (the filelist for Precise is here) 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 restore-trash 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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