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.
- Right-click the Trash icon on the Ubuntu taskbar/dock, then select Empty Trash from the displayed options.
- 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.
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.
- Double-click the Trash icon on the Ubuntu taskbar to open the folder.
- In the Ubuntu File Manager, click the Empty… button in the Trash folder.
- Consequently, a dialogue box with a warning will appear on your screen. Hence, click the red Empty Trash button to empty the trash.
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.
- 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.
- 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
- Finally, execute the rm command below to delete all the files in the Trash folder.
rm -rf *
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.
- 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.
- 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
- Consequently, the trash-cli utility should start to install on your Ubuntu computer.
- When the utility has been successfully installed, run the trash-empty command below to empty the trash.
trash-empty
Frequently Asked Questions
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.
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.
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.
The first version of the Ubuntu operating system (Ubuntu 4.10) was released on October 20, 2004.
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.