Linux: gnome, xfce, where is trash location

Perm URL with updates:

What's the Linux command to put things in trash?

You can do gvfs-trash ‹filepath›.

Where is the trash folder?

Example trash location:

  • 〔~/.local/share/Trash/〕 → on your local file system.
  • 〔/media/PENDRIVE/.Trash-1000/〕 → on a USB drive.
  • 〔/root/.local/share/Trash/〕 → if you are root, on your local file system.

How does Linux Trash Work?

In the trash dir, there are 3 dirs:

  • 〔expunged〕→ (this is not in spec.)
  • 〔files〕 → contains the actual trashed files.
  • 〔info〕 → contains text file that has info about trashed file.

For example, if you have a file at 〔/home/jane/Downloads/cat.jpg〕 and you deleted to trash. Then, you'll have:

  • 〔~/.local/share/Trash/files/cat.jpg〕
  • 〔~/.local/share/Trash/info/cat.jpg.trashinfo〕

and the file 〔cat.jpg.trashinfo〕 will have content like this:

[Trash Info]

You can delete the trash dir. ⁖ rm -rf ~/.local/share/Trash/.

Reference. 〔The Trash specification @…

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs