Jump to content

3 Ways to Remove Files from Trash on Ubuntu using GUI and Terminal


aum

Recommended Posts

By choosing files and documents and hitting the “Remove” key on the keyboard, users can remove all data. Those files are then moved to Junk, a computer location for discarded data. Deleted files remain inside the "Trash" folder unless you elect to clear it or restored the contents. Throughout this article, we'll look at the first choice: how and where to delete documents via Trash.

 

Method 01: Using File Manager to empty Trash on Ubuntu


This approach will be performed through the user interface, therefore those who aren't used to utilizing the console might go with this one. Use the sidebar to access Ubuntu's file manager. A collection of available folders may be seen from the left side. Double-click on the icon of “Trash” from the desktop of Ubuntu.

 

word-image-2903.png

 

It will directly open the File Manager “Trash” folder of your Ubuntu System. You can see we have a deb file in our Trash folder. So, we will be deleting this file. The first way is used to delete all the files and folders from the “Trash” using the “Empty” button highlighted at the top right corner of the Trash folder window.

 

word-image-2904.png

 

A dialogue box will be appeared as below showing a warning. It is asking you if you want to delete all the data from the Trash or not? If one wants to empty the Trash folder then they can simply hit it off on the button of “Empty Trash”. Otherwise, tap the Cancel button. This will delete all the files from the Trash folder.

 

word-image-2905.png

 

Try to ensure that there were no essential files on your computer before continuing. To delete a file click on it. You will see that the Restore button will also be highlighted during this. Whether there are any important files, use the “Restore” button. If not, hit the “Trash” button. Another way is by right-clicking on the file first. You can choose any one option you want to do. You can also restore the file and delete it permanently. Hence, tap on the option of “Delete from Trash”.

 

word-image-2906.png

 

A dialogue given below will be opened making sure that you want to delete a particular file. Hit the “Delete” button to carry on.

 

word-image-2907.png

 

Method 02: Using Command-Line to empty Trash on Ubuntu


Using the “Ctrl+Alt+T” shortcut way, you need to launch the console application in your Ubuntu system. Now the terminal is opened, we have to first move towards the “Trash” folder held in our system through it. So, we need the “cd” command with the path to be followed in it. As you can see, we have used the below “Cd” query to get throughout the “Trash” folder.

 

$ cd ./local/share/Trash

 

word-image-2908.png


Now travel en route for the “files” directory via “cd” instruction as follows:

 

$ cd files

 

word-image-2909.png

 

Now, we can list the contents and files of this folder by simply utilizing the “ls” query. We have only one file in this folder yet.

 

$ ls
 

word-image-2910.png

 

To remove all the files from the trash folder, try out the below “rm” command as below.

 

$ rm –rf *

 

word-image-2911.png


Now when you list the contents of this folder, you will find the folder empty.

 

$ ls

 

word-image-2912.png

 

 

Method 03: Using Trash-cli to remove files from Trash on Ubuntu


In this method, we need to first install the “trash-cli” package via terminal in our system. Hence, we have used the apt package command to do so with sudo rights. Add your sudo password to continue this processing.

 

$ sudo apt install trash-cli

 

word-image-2913.png

 

For continuing the process of trash-cli, tap “y” and smash the “Enter” button.

 

word-image-2914.png

 

Wait for a little until it finishes its installation.

 

word-image-2915.png

 

Now the installation procedure is finished, we can go forward.

 

word-image-2916.png

 

Using the below command we can empty the trash from the trash folder.

 

$ trash-empty

 

word-image-2917.png


 

Conclusion


We have presented three viable techniques for clearing your trash on Ubuntu in this post. Hopefully, these approaches will be beneficial to you and helped you complete your task!

 

Source

Edited by aum
Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...