197

Using Ubuntu 11.10, I accidentally deleted a file that was approximately 700 MB. I tried to find it in the in following locations, but couldn't:

/home/user/.local/share
/home/user/ <-- there was no folder .Trash
/home/user/Desktop/ <-- there was no folder .Trash

So where did .Trash go in Ubuntu 11.10 onward? I use the Gnome environment.

1
  • I find /home/user/.local/share after installing trash-cli with sudo apt-get install trash-cli Oct 17, 2019 at 3:16

5 Answers 5

283

Your trash directory is most likely at:

/home/$USER/.local/share/Trash

If you deleted something as root (e.g. deleted a file using Nautilus invoked via gksu), it is at:

/root/.local/share/Trash

(In general, according to Freedesktop.org specifications[1][2], the "home trash" directory is at $XDG_DATA_HOME/Trash, and $XDG_DATA_HOME in turn defaults to $HOME/.local/share.)

To see .local in your home folder using the file manager, select Show Hidden Files from the View menu or just type Ctrl+H.

The Trash directory is first created when a user deletes a file. Within Trash there are three subdirectories:

  • files, where the deleted files are stored until the trash is emptied
  • info, which stores information on where the files once were and when they were deleted
  • expunged, to which files are briefly moved when the trash is emptied (but may contain some owned by other users from directories you deleted).

Note that using the rm command in a terminal or the Shift+Delete key combination in the file manager will permanently delete your file instead of moving it to the trash.

7
  • 6
    If using command line to mv something to the Trash, you may need to put it in Trash/files/ rather than just Trash/. The files did not appear in the Trash GUI until I did that.
    – AlexMA
    Jun 6, 2014 at 16:50
  • Yes; I added some info to address this.
    – Fern Moss
    Jun 9, 2014 at 23:29
  • The locations still apply in 14.04
    – Elder Geek
    Dec 3, 2015 at 18:57
  • 2
    If you want to move file to Trash from command line, run: gvfs-trash filepath. Aug 7, 2016 at 10:11
  • 1
    An alternative to gvfs-trash is the trash command from the trash-cli package.
    – JanKanis
    Feb 15, 2018 at 13:38
52

The trash folder is located at .local/share/Trash in your home directory.

Additionally, on other disk partitions or on removable media it will be a directory .Trash-uid where uid is the uid of the user who moved the item to the trash.

4
  • I cannot see this folder in my home directory. i am using ubuntu 14
    – Vivek
    Jun 7, 2016 at 19:21
  • @Vivek Files and directories whose names start with a dot (.) are hidden by default. In Nautilus, you can press CTRL+H to show them. Jun 7, 2016 at 20:40
  • Good answer. Telling how to see your uid would also be useful. Jun 22, 2019 at 21:59
  • that folder does not exist May 7, 2021 at 15:44
6

Ubuntu 10.10 (oneiric)

Gnome 3.2.1 Classic

Home Folder > Go > Rubbish Bin

5

Explore the folder, and there you'll see the trash button:

enter image description here

0

On ubuntu 22.04 to recover Trash folder on Desktop, enter command

gsettings set org.gnome.shell.extensions.ding show-trash true 

To hide the icon again, run the command below to reset the key:

gsettings reset org.gnome.shell.extensions.ding show-trash

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .