I tried opening Trash by running the command nautilus
, but it gives me an error.
Asked
Active
Viewed 1.9e+01k times
64

Zanna
- 70,465

Suhas Shetty
- 759
- 1
- 5
- 4
-
4Could you be more specific, which error did you get and which command did you use – Leon palafox Aug 02 '13 at 18:15
-
1Related: Command to move a file to Trash via Terminal – wjandrea Sep 15 '17 at 19:12
4 Answers
89
The trash folder should be located under:
/home/your_username/.local/share/Trash
So you should be able to access it via:
cd ~/.local/share/Trash
The folder might not exist unless you delete something from the filesystem. In this case you would run into an error (saying that the folder does not exist).
28
If you want to open Trash using Nautilus run the following:
nautilus trash://

Liam Baker
- 129
- 2
- 9

Eric Carvalho
- 54,385
-
Or if you want to open the default app: "gvfs-open trash://". If Nautilus is your default, it will open the trash. – Jo-Erlend Schinstad Oct 03 '17 at 11:19
13
For Ubuntu 18.04 and newer, use gio
. For older versions, use gvfs-ls
and gvfs-trash
.
To read the trash:
gio list trash://
gvfs-ls trash://
To send files or directories to the trash:
gio trash [FILE or DIR]
gvfs-trash [FILE or DIR]
To empty it:
gio trash --empty
gvfs-trash --empty

wjandrea
- 14,236
- 4
- 48
- 98
-
1This should be the accepted answer now,
gio
works for all mount point, which isn't the case of the accepted answer, alsogio
offers a better cli interface to trash handling – bric3 Dec 13 '19 at 13:02 -
2How to restore/recover a file with
gio
? With trash-clie I can dotrash-restore
and then select a file to restore! I couldn't find an alternative withgio
. see here – Farid Cheraghi Apr 27 '20 at 07:59
4
You can list all the files in the trash by using trash-list
. First, install it by running:
sudo apt install trash-cli
Now, you can list the files by running:
trash-list
You may be interested in these other commands too:
Command | Description |
---|---|
trash-restore |
Restore file from trash. |
trash |
Command line trash utility. |
trash-empty |
Empty trash. |
trash-list |
List trashed files. |
trash-put |
Put file in trash |
trash-rm |
Removes files matching a pattern from the trash can. |

Flimm
- 41,766