0

I am with Linux Mint, I delete a file with caja, it is the file manager for Mate Desktop. Because caja is open as root, now the file which I delete is on the root Trash...

I try as David Yockey to say,

enter image description here

The First I to try to look is the File which delete rescuee.img but to say , Das Argument ist ungültig - Argument is invalid and keine Berechtigung - Not authority..

With the seconds, junk_file, I to come similar...

My question, how can restore this file?

can someone help me, thanks!

  • The invalid argument listings correspond to find trying to search particular directories that it can't access. It looks like it found rescuee.img in the directory /media/.../cff201e8-c3bc-4517-95d9-862c547f26f2/.Trash-0/files/. It's not in that directory, is it? – David Yockey Nov 10 '19 at 16:02
  • yes, now to try again the file to rescue and it belongs to them... – dsaj34v Nov 10 '19 at 16:12
1

Take a look in /root/.local/share/Trash/files. I ran Caja as root, created a file in /root, deleted it, poked around a bit, and found it in that folder. I was then able to cut & paste it from there back into /root.

| improve this answer | |
  • Thanks for you answer!, on my folder share I have not a Trash folder.. – dsaj34v Nov 10 '19 at 14:28
  • I'd try a bit of detective work, then... In Caja running as root, create a file with a unique name like junk_file and then delete it. Then, log into a root terminal, run find / -name junk_file, and see where it landed. If it's found, you can get it back from there (you should be able to view that location in Caja as well). If not, I'd conclude that your Caja, at least when running as root, is immediately deleting files rather than moving them to a trash directory. – David Yockey Nov 10 '19 at 14:42
  • Thanks, now I will new Edit my question... – dsaj34v Nov 10 '19 at 15:00
  • Because Now rescue again my file with ddrescue, not to need my old file. I wish your a nice Day! – dsaj34v Nov 10 '19 at 17:42
1

I don't find this accepted answer entirely satisfactory: files or directories which are sent to Trash have their original location somehow recorded with them so that it is possible to restore them without necessarily knowing that original location.

As a non-root user you can usually use your file explorer, Nemo in my case (OS Linux Mint 18.3), to restore, by clicking Trash and then finding the restore command in the context menu (right-click) of the file in question.

When you run Nemo as root (gksudo nemo) however, this doesn't work: the Trash bounces your focus away, giving you a "no access" message, and doesn't display its contents properly.

But there is a solution which I found: install the trash-cli package.

One of the commands there is restore-trash, incidentally wrongly documented as trash-restore(1) in the man trash page under "SEE ALSO". Going, instead,

man 1 restore-trash 

shows you how this command works: you choose a number from the listed files. You don't need to know the restore location.

Without the trash-cli package I have no idea whether this is possible.

| improve this answer | |
  • Very thanks for your answer!, as I to say, I rescue it with ddrecue, but I'll save your answer on my computer as firs aid when next time does the same mistake ... – dsaj34v Jan 20 at 9:46
  • Umm... I think you'll find that ddrescue does NOT supply the original location where the file was when it was sent to trash. So my answer is the normal way to restore. ddrescue would be the "first aid", or rather the "last resort". – mike rodent Jan 20 at 10:21
  • yes, you have the right, therefore next time that I to delete a file on caja, I'll use your recommendations... – dsaj34v Jan 20 at 10:32

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.