Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this questionI'm wondering if it is possible to restore a file that is in the trash (~/.Trash
) to its original location.
I understand there is a restore command but I don't understand its arguments or how to correctly use it.
Is this a fairly simple thing to do?
Cheers
If your desktop environment followed the XDG Trash Can Specification when trashing the file, then restore-trash
from trash-cli would do the trick.
What desktop do you use?
.Trash
is just a (hidden) directory. All you need to do is move it out:
mv ~/.Trash/foo ~/
or using the file browser of your desktop environment, open the trash and drag it out.
As far as I know, in the trash folder (~/.local/share/Trash/
), there is a folder with the files (files/
) and a folder with the file information (info/
). Each file has an associated .trashinfo
file in which the original path and time of deletion are stored. You can use that to restore the file to its original location.
精彩评论