Find Trash Location Through Terminal on Ubuntu

Find Trash Location Through Terminal on Ubuntu

When working on the Ubuntu system, it's easy for files to accidentally end up in the trash, especially when you're cleaning up your workspace or deleting unnecessary items. Locating the trash folder might seem like a simple task, but for those new to the Ubuntu environment, it can be a bit confusing. We can find the trash using the graphical user interface (GUI). What many users might not be aware of is that we can also achieve this task using the terminal. This tutorial shows how to find trash location through terminal on Ubuntu.

By default, the trash should be located under /home/$USER/.local/share/Trash directory. So you should be able to access it via command:

cd ~/.local/share/Trash

Within Trash there are three subdirectories:

  • files - directory where the deleted files are stored. When a file is moved to the trash, it's placed in this directory. The files remain in this directory until they are either restored to their original location or permanently deleted.
  • info - directory contains metadata and information about the deleted files. Each file in the files directory has a corresponding file in the info directory that holds details about the original file, such as its name, location, and other attributes. This metadata helps the system manage and provide information about the deleted files, especially when they are restored or permanently removed from the trash.
  • expunged - directory is used to store information about files that have been deleted from the trash but are still awaiting permanent removal. This directory helps in managing the process of expunging, or completely removing, the files from the system. When files are deleted from the trash, they are usually moved to the expunged directory until the system gets around to permanently removing them.

Leave a Comment

Cancel reply

Your email address will not be published.