Trash CLI is a very handy tool for deleting or restoring files from a Linux system's trash. You can also delete files from your system's trash manually, however, if you have such a utility available, it gets very convenient for you to perform this task via the terminal instead of going all the way to your system’s trash.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux system tools queries.
In this context, we shall look into how you can install and use the Trash CLI utility on a Linux Mint 20 system.
How to Install Trash CLI on Linux Mint system ?
To install the Trash CLI on your Linux Mint 20 system, you just need to execute the following command:
$ sudo apt update && sudo apt install trash-cli
You will have to hit the "Y" character to confirm your installation once you will be asked for it.
How to use Trash CLI on Linux Mint 20 ?
Now, to use the Trash CLI on your system after installing it, you need to perform the following outlined steps.
1. View the Contents of your System's Trash
To begin, you need to view the contents of your system's trash because after all, we will attempt to empty it. Therefore, the trash must hold something in it. You can click on the file manager icon and go to the Trash tab to view its contents.
Alternatively, you can launch the terminal and run the below command:
2. Remove all the Contents of your System's Trash
Here, we will try to remove all of these files by running the below command:
Note that the above command will not generate any output. Therefore, to verify if the contents of the Trash have actually been deleted or not, you will have to perform the following step.
3. Verify if all the Contents of your System's Trash have been removed or not
You will need to run the "$ trash-list" command once again but this time it will not produce any output because your Trash has been cleaned up successfully:
How to Uninstall Trash CLI from your Linux Mint 20 system ?
To uninstall the Trash CLI from your system, you will need to execute the following command:
$ sudo apt-get purge --autoremove trash-cli
[Need to Install any Software on Linux Mint system ? We can help you. ]