Empty trash linux7/24/2023 ![]() ![]() Some distributions will have trash-cli in their default repositories. In this Linux quick tip we will show you how to install and use this nifty little utility. Enter Trash-CLI, the command line interface to the Linux trash can. Sure, you may be able to restore the file from disk, but it is not trivial or fast. Unlike using a GUI, there is no Trash folder (Recycle Bin) in a terminal. These are simple yet efficient ways to save time and keep your system clutter-free.If you work on the Linux command line long enough, you will eventually delete a file by accident. This is how you can empty the trash automatically either through the Ubuntu settings or the Autotrash utility. If you need to empty the trash right now, click the Empty Trash button. You can also set time period based on how often you want to automatically delete the content. You can also enable Automatically Delete Temporary Files to remove temporary files. Under Trash & Temporary Files, enable Automatically Delete Trash Content. From the left tab in the Settings window, go to Privacy > File History & Trash. Open the Settings utility from the Right-click context menu or the Activities menu. autotrash -d 10 -max-free 1024 Method#2 Automatically Empty the Trash in Ubuntu Using Gnome SettingsĪnother way to automatically empty the trash in Ubuntu is by using the Gnome Settings. Autotrash will not delete any content until it reaches this threshold. For instance, you can specify Autotrash to empty the trash when the available space at the trash location falls below 1024 megabytes. On Ubuntu, the trash folder is located at /home/username/.local/share/Trash/. You can also empty trash based on free space left at your Trash location. This feature allows you to restore any content before the specified threshold if needed. For instance, to delete content that has been in the trash for more than 5 days, you can use the following command: $ autotrash -d 5 Now you would be able to launch Autotrash using the following simple command: $ autotrashĪfter the Autotrash utility is installed, you can delete the content in the Trash older than x number of days. If you find this command a little longer, you may set its alias simply as autotrash using: $ sudo snap alias autotrash-unofficial autotrash ![]() Provide your password for authentication and it will install Autotrash on your system.Īfter installation, you can launch the Autotrash utility using the following command: $ autotrash-unofficial To install the Autotrash snap application, open the Terminal in your system and run the following command: $ sudo snap install autotrash-unofficial ![]() However, you can install it by using its snap application. Autotrash is not available in the Ubuntu official repositories. On Ubuntu, you can automatically empty the trash using the Autotrash utility. Method#1 Automatically Empty the Trash in Ubuntu Using Autotrash Luckily in Ubuntu 22.04, you have the option to configure your machine to automatically empty the trash. However, it’s easy to forget to manually empty the trash. Regularly emptying the trash is essential to keep your system clean and free up storage space. When you delete a file in your Linux system, it goes to Trash and accumulates over time. To keep your system clean and organized, it is important to delete unnecessary files and the items that are no longer required. ![]()
0 Comments
Leave a Reply. |