• Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
  • Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
Home»Distros»Ubuntu»How To Empty Trash In Ubuntu

How To Empty Trash In Ubuntu

Anup ThapaBy Anup ThapaMay 13, 2023 Ubuntu 2 Mins Read

Deleted files in Ubuntu are normally moved to the trash. This is nothing unusual, but what’s different compared to most platforms is that the trash isn’t automatically cleared after a set time. 

This feature (30 days) is toggled off by default, meaning you can accumulate a lot of trash after a while. So, it’s important to either turn on auto-deletion or manually empty the trash as we’ve shown in this article.

Empty Trash Graphically

Although there are multiple ways to empty the trash via the GUI, only the steps are different. The end result is the same regardless of how you do it.

  • You can right-click the Trash icon from the dock and select Empty trash.
    ubuntu dock empty trash
  • You can right-click Trash from the file explorer and select Empty trash.
    nautilus empty trash
  • You can select specific items to delete while inside the Trash directory. Or, you can click on Empty to delete all items.
    delete from trash ubuntu
  • You can open Trash Settings and empty the trash from there. Additionally, you can also delete temp files, turn on auto-deletion, or set the time period.
    file history and trash

Empty Trash via Terminal

Occasionally, due to permission issues and the like, you won’t be able to graphically delete some items from the trash. In such cases, you can use the rm command.

On recent Ubuntu versions, the Trash directory can be found at ~/.local/share/Trash.

This path may differ on older versions, so adjust it as appropriate. And as we’re using rm with root privileges, make sure to double-check the file paths as it’s very easy to delete the wrong file or directory.

Now, to delete a specific file from the trash, use rm like so

sudo rm ~/.local/share/Trash/files/sampleimage.png

If you want to empty everything from the trash, use the following command instead. We’re using the r and f options to recursively delete files and ignore any errors or warnings.

sudo rm -rf ~/.local/share/Trash/*
Anup Thapa
  • LinkedIn

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. At LinuxStart, Anup is an integral part of our editorial team. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys experimenting with different Linux distros and reading up on things like networking and virtualization.

Leave A Reply Cancel Reply

Table of Contents
  • Empty Trash Graphically
  • Empty Trash via Terminal
Linux Start
Guides

What is the Linux Kernel?

The Linux Kernel is the core of the Linux operating system and is central to…

How To Install Linux Mint

How To Install Linux on VirtualBox

Getting Started with Linux

How to Install Linux

10 Best Linux Distros of 2023

Which Linux Distro Should You Choose? A Complete Guide to Help You Decide

© 2023 LinuxStart.com

Type above and press Enter to search. Press Esc to cancel.