Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 3 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

restore-trash

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
add comment

Your Answer

 
discard

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.