194

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.

Braiam
  • 66,947
  • 30
  • 177
  • 264
Registered User
  • 4,904
  • 11
  • 37
  • 43

5 Answers5

280

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.

Jani Uusitalo
  • 853
  • 1
  • 8
  • 22
Fern Moss
  • 8,685
  • 6
  • 42
  • 61
  • 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 06 '14 at 16:50
  • Yes; I added some info to address this. – Fern Moss Jun 09 '14 at 23:29
  • The locations still apply in 14.04 – Elder Geek Dec 03 '15 at 18:57
  • 2
    If you want to move file to `Trash` from command line, run: [`gvfs-trash filepath`](https://www.mankier.com/1/gvfs-trash). – patryk.beza Aug 07 '16 at 10:11
  • 1
    An alternative to `gvfs-trash` is the `trash` command from the `trash-cli` package. – JanKanis Feb 15 '18 at 13:38
  • when i manually move the file to the trash/files folder and manully write the file.trashinfo file in the trash/info folder myself . It doesn't show the "restore from trash" option in the Trash . How to fix it ? – Natesh bhat May 14 '18 at 23:24
  • Why is `trash` in `/home/../.local/share` and not in `/home/user`? – Timo Jun 05 '21 at 10:46
49

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.

dsh
  • 362
  • 1
  • 8
Eric Carvalho
  • 53,609
  • 102
  • 137
  • 162
6

Ubuntu 10.10 (oneiric)

Gnome 3.2.1 Classic

Home Folder > Go > Rubbish Bin

user67684
  • 61
  • 1
  • 1
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
Vitalicus
  • 143
  • 4