1

When trying to access the Trash area in Nautilus when running it from Terminal with the command:

sudo nautilus

I get this error:

This location could not be displayed

Is this because it is trying to access trash://// which is the not real path (the real path is /home/<username>/.local/share/Trash)? And if so is this some sort of bug, or is it somehow by design?

2
2

You ran Nautilus from the root account (sudo) and you're trying to access the Trash.

Normally, every user account has its own Trash, but root account doesn't have one. Because of elevated privileges, if you delete files while you're being root they'll be deleted immediately - no confirmations will be shown.

(Keep in mind that you should be very careful doing something as root!)

3
  • 1
    Root can have one, it just is different to the normal users
    – Wilf
    Feb 23 '15 at 21:45
  • Root has definitely a trash folder: /root/.local/share/Trash/
    – Byte Commander
    Mar 12 '15 at 10:39
  • im guessing nautilus searches for user's trash folder in /home/username, but root doesn't have a folder in /home. But that's just a theory May 3 '15 at 4:34
1

@user300458, you are mistaken my friend. The files you move to trash as sudo DO NOT get automatically deleted. It is a Nautilus bug as Paranoid Panda suspected. The trash can is not referenced properly here.

All files that were moved to trash can be found in: /root/.local/share/Trash/files - if you go there, you will find all the stuff you sent to trash intact and waiting for deletion.

I'm going to see if I can find a way to fix the reference for the trash on google.

In the meantime, you can empty it by browsing to /root/.local/share/Trash/file and opening the terminal and putting in:

rm -r *

There are also files in /root/.local/share/Trash/info. You can clean them out too if you care but those are small files.

---------------------------------------------------------- [EDIT] ----------------------------------------------------------

I didn't find much but I kind of lost interest when I saw a post from 2008 with the same problem.

I just made a shell script:

rm -r -f -d /root/.local/share/Trash/files/*

rm -r -f -d /root/.local/share/Trash/info/* 

And I left it in: /root/.local/share/Trash

Which I bookmarked in Nautilus. So, if I want to see the content of trash, I click on the files subdirectory and if I want to empty trash, I run the script.

1
sudo chown -hR user:user ~/.local./share/Trash

You can now empty trash from Nautilus as a normal user, but not sure if permanently fixed.

1

Try this:

sudo apt install trash-cli

Then:

sudo trash-empty

System should find it.

2
  • Is sudo trash-empty needed, or could we use trash-empty for local user?
    – DankyNanky
    May 21 '20 at 10:25
  • trash-empty without sudo should empty current user trash only.
    – Fred Toop
    May 21 '20 at 18:48
0

On my ubuntu 19.04, I deleted some files as root on nautilus which I coudn't remove from Trash in nautilus.
There was no /root/.local/share/Trash folder on my system, but there was /home/<username>/.local/share/Trash/files. I simply cd to this directory and ran sudo rm -rf * and now there are no files in Trash as seen on nautilus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy