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'm new with Ubuntu and used the command sudo -s to become root and executed nautilus to open my Nautilus Elementary as root.

While managing my files, I wrongly pressed the "Delete" button on my important folder.

I thought that folder will going to Trash folder, but if I click on Trash (in nautilus running as root) my nautilus was immediately closed, with the below error in a terminal:

** (nautilus:30221): CRITICAL **: nautilus_file_get_location: assertion `NAUTILUS_IS_FILE (file)' failed

(nautilus:30221): GLib-GIO-CRITICAL **: g_file_get_uri: assertion `G_IS_FILE (file)' failed ** ERROR:nautilus-window-manage-views.c:819:begin_location_change: assertion failed: (location != NULL)

On other user accounts, the trash folder seems to be in .Trash, but but in /root, there is no such directory.

Where is my folder that I deleted?

share|improve this question
    
If I using Window$ I can go to recycle bin and restore it... how about my ubuntu... –  Smile.Hunter Jul 27 '11 at 10:34
    
finally, I though my root's Ubuntu, didn't have a Trash. ubuntuforums.org/showthread.php?t=1813078 –  Smile.Hunter Jul 29 '11 at 9:21
add comment

3 Answers

up vote 2 down vote accepted

open nautilus as root:gksu nautilus then, after entering your password, you will have the nautilus windows. press Ctrl+H to show the hidden files then go to /home/.trash-0 all your deteted files during your root session should be there.

share|improve this answer
    
Just wanted to say, this would work but if you want to run nautilus as root it would be better use the gtk frontend for it: gksu nautilus instead of sudo nautilus. –  darent Jul 27 '11 at 14:54
    
thanks darent, i think gksu is the appropriate command. –  amixr Jul 28 '11 at 14:30
    
there are not .trash-0 to, there are "my user" folder and ".ecryptfs" folder.. –  Smile.Hunter Jul 29 '11 at 9:17
    
ok, finally I found it at /home/myuser/.trash-0 .... –  Smile.Hunter Aug 2 '11 at 13:59
add comment

.Trash is a hidden folder. If you cannot find it, try to open /root/.Trash manually. In a terminal, you can get a directory listing of it by running:

sudo ls -lA /root/.Trash

Never run as root unless you're sure what you're doing.

share|improve this answer
    
Ok, but .. ls: cannot access /root/.Trash: No such file or directory && cp: cannot stat `/root/.local/share/Trash/files': No such file or directory ... –  Smile.Hunter Jul 27 '11 at 11:16
2  
+1 for "never run as root unless..." –  Takkat Jul 27 '11 at 11:41
1  
@Smile: if you know what your file was named like, try sudo find /root -name '*important*' -ls. If you want to do a case-insensitive search, use -iname instead of -name. If your file starts with Some and ends with .odt, use 'Some*.odt' instead of '*important*'. –  Lekensteyn Jul 27 '11 at 17:43
add comment

At least in Ubuntu 13.04 and above (not sure exactly when the switch was made), any files deleted in nautilus when running as root can instead be found in:

/root/.local/share/Trash

The actual files will be in a files directory, while some extra data (which stores information such as when the data was deleted and its original location) can be found in the info directory.

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.