How to Empty Trash in Ubuntu

Photo of author

By Oluwaseun Bamisile

Published

Do you wish to empty the trash folder on your Ubuntu computer but need help with that? You should read through this guide as it features numerous methods to accomplish that.

Option 1: Empty Trash Through the GUI

There are two ways you can empty the trash on your Ubuntu computer via the GUI (Graphical User Interface). You can either empty the trash using the trash icon on the taskbar/dock or through the Ubuntu File Manager.

The following sub-sections demonstrate how to empty the trash in Ubuntu through the GUI using the aforementioned means.

Method 1: Empty Trash Through the Taskbar/Dock

One of the fastest ways to empty the trash on your Ubuntu computer via the GUI is through the taskbar. To do that, follow the procedures below carefully.

  1. Right-click the Trash icon on the Ubuntu taskbar/dock, then select Empty Trash from the displayed options.
  1. Following that, you should receive a warning saying all the items in the Trash will be permanently deleted – click the red Empty Trash button to empty the trash.
Empty Trash In Ubuntu Through The GUI

Method 2: Empty Trash via the File Manager

As mentioned earlier, you can also empty the trash on your Ubuntu computer through the GUI by using the File Manager. In order to accomplish that, carefully execute the following procedures below.

  1. Double-click the Trash icon on the Ubuntu taskbar to open the folder.
  1. In the Ubuntu File Manager, click the Empty… button in the Trash folder.
Empty Trash In Ubuntu Through The GUI
You can also right-click the Trash icon on the right pane of the File Manager window, then select Empty Trash… from the displayed options.
  1. Consequently, a dialogue box with a warning will appear on your screen. Hence, click the red Empty Trash button to empty the trash.
Empty Trash In Ubuntu Through The GUI

Option 2: Empty Trash via the Terminal

As expected, you can also empty the trash on your Ubuntu computer through the terminal. As a matter of fact, there are multiple command lines to perform this task through the terminal.

The subsequent sub-sections illustrate how to use these command lines to empty the trash in Ubuntu through the terminal.

Method 1: Empty Trash Using the Rm Command

The rm command is one of the multiple commands to empty the trash in the Ubuntu operating system. To make use of this command to empty the trash, observe the following procedures and screenshots below carefully.

  1. Launch the terminal in Ubuntu by right-clicking any free space on the desktop and selecting Open in Terminal from the displayed options. The Ctrl + Alt + T keyboard shortcut is also an alternative to open the terminal in Ubuntu.
Empty Trash In Ubuntu Via Terminal
  1. When the terminal opens on your Ubuntu computer, first execute the command below to access the Trash directory and files. However, replace “computername” with the name of your Ubuntu computer before running the command.
cd /home/computername/.local/share/Trash/files

For example, the name of my Ubuntu computer is “itechguides”. Hence, below is what the command should look like on my computer.

cd /home/itechguides/.local/share/Trash/files
  1. Finally, execute the rm command below to delete all the files in the Trash folder.
rm -rf *
Empty Trash In Ubuntu Via Terminal

Method 2: Empty Trash Using the Trash-empty Command

The trash-empty command is another command that can be used to empty the trash in the Ubuntu OS through the terminal. However, this command cannot work if you don’t have the trash-cli utility installed on your Ubuntu computer.

Hence, the following procedures demonstrate how to install the trash-cli utility through the terminal and use the trash-empty command.

  1. Right-click any free space on the Ubuntu desktop and select Open in Terminal from the displayed options to launch the terminal. You can also use the Ctrl + Alt + T keyboard shortcut as an alternative to open the terminal in Ubuntu.
  1. In the Ubuntu terminal, run the subsequent command below to install the trash-cli utility. Then, you will be asked to input your computer password – do that and press the enter key to proceed.
sudo apt install trash-cli
Characters won’t be visible when typing your password
Empty Trash In Ubuntu Via Terminal
  1. Consequently, the trash-cli utility should start to install on your Ubuntu computer.
  1. When the utility has been successfully installed, run the trash-empty command below to empty the trash.
trash-empty
Empty Trash In Ubuntu Via Terminal

Frequently Asked Questions

1. Is there a trash folder in Ubuntu?

Yes, the Ubuntu operating system features a trash folder where every deleted file is stored. This folder can be found on the Ubuntu taskbar or File Manager.

2. How do I permanently delete deleted files in Ubuntu?

You can permanently delete deleted files on your Ubuntu computer by emptying the trash folder. To do that, follow the procedures below.
a) Right-click the Trash icon on the Ubuntu taskbar/dock and select Empty Trash from the displayed options.
b) Then, you should receive a warning saying all the items in Trash will be permanently deleted – click the red Empty Trash button to proceed.

3. Is Ubuntu Linux?

Yes, the Ubuntu operating system is a Linux-based operating system. Basically, the Ubuntu OS is one of the distributions of the Linux operating system.

4. When was Ubuntu released?

The first version of the Ubuntu operating system (Ubuntu 4.10) was released on October 20, 2004.

5. What is the latest version of the Ubuntu OS?

As of the time I wrote this guide in November 2022, the latest version of the Ubuntu OS is Ubuntu 22.10, which was released on October 20, 2022.

Conclusion

Emptying the trash files frees up space on your computer. Fortunately, I demonstrated multiple methods to empty the trash on your Ubuntu computer.

To be more specific, we learned how to perform the task through the Ubuntu GUI. This guide also taught us how to empty the trash via the terminal.

I hope this guide was helpful to you. If it was, click on “Yes” beside the “Was this page helpful” question below.

You may also express your thoughts and opinions by using the “Leave a Comment” form at the bottom of this page.

Finally, visit our Linux how-to page to get more Linux guides.

About the Author

Photo of author

Oluwaseun Bamisile

Oluwaseun is the Lead Content Editor at Itechguides.com. He holds a National Diploma in Computer Science (currently studying part-time for his Higher National Diploma). An internet geek with a love for automobiles, he writes product reviews, tech articles, and how-to guides on the site.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment