Autotrash is a command line program that automates the process of cleaning out old deleted files. It will clear files in the Recycle Bin that are older than the specified number of days. You don't need to empty the Recycle Bin or perform SHIFT+DELETE to permanently clear files/folders. Autortrash will process the contents of your Recycle Bin and automatically delete them after a certain period of time. In short, your trash will never get too big with Autotrash. Install Autotrash Autotrash is included by default in the repository on Debian based systems. To install autotrash on Debian, Ubuntu, Linux Mint, run: On Fedora: For Arch linux and its variants, you can install it using any AUR helper program like Yay. Automatically clean up old junk files Whenever you run autotrash, it scans your ~/.local/share/Trash/info directory and reads the .trashinfo files to find out their deletion dates. If files have been in the Recycle Bin for longer than the specified date, they are deleted. Let me give you some examples To delete files in the Recycle Bin that are older than 30 days, run: As shown in the example above, Autotrash automatically deletes files from the Recycle Bin if they are older than 30 days. You don't need to delete them manually. Just put useless files in the Recycle Bin and forget about them. Autotrash will take care of deleted files. The above command processes the trash directory of the currently logged in user only. If you want autotrash to process all users' trash directories (not just those in your home directory), use the -t option, as shown below: Autotrash also allows you to remove deleted files based on the available capacity of the Recycle Bin or the available space on the disk. For example, consider the following example: According to the above command, if the remaining space in the Recycle Bin is less than 1GB, autotrash will clear deleted files older than 30 days from the Recycle Bin. This may be useful if your Recycle Bin is running low on space. We can also clear files from the Recycle Bin by oldest time until the Recycle Bin has at least 1GB of space. In this case, there is no restriction on old deleted files. You can combine these two options (--min-free and --max-free) in one command as follows According to the above command, if the free space is less than 2GB, autotrash will read the Recycle Bin and then focus on the capacity. At this time, files older than 30 days are deleted, and if there is less than 1GB of free space, newer files are deleted. As you can see, all commands should be run manually by the user. You might be wondering, how can I automate this task? It's easy! Just add autotrash as a crontab task. Now the command will run automatically at the scheduled time and clear the files in the Recycle Bin according to the defined options. To add these commands to your crontab, run: Add tasks, for example: Now, autotrash will purge files in the recycle bin every day that are older than 30 days. Please note that if you accidentally delete any important files, they will be gone forever after the specified date, so be careful. See the man page for more information about Autotrash. Empty the Recycle Bin or press SHIFT+DELETE to permanently delete useless things from your Linux system. It's no big deal. It only takes a few seconds. However, if you need an additional program to deal with junk files, Autotrash might be able to help. Try it and see how it works. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Manually install mysql5.7.10 on Ubuntu
>>: js implements mouse switching pictures (without timer)
When we want to add a shadow to a rectangle or ot...
All-round system monitoring tool dstat dstat is a...
If you use docker for large-scale development but...
During the project, I started using the js reques...
tar backup system sudo tar cvpzf backup.tgz --exc...
This article shares the specific code of React+ts...
Table of contents Variable type and storage space...
We all know that Apache can easily set rewrites f...
Pop-up windows are often used in actual developme...
Preface My needs are syntax highlighting, functio...
If there is an <input type="image">...
This article shares the specific code for WeChat ...
Image Accelerator Sometimes it is difficult to pu...
1. Background 1.1 Problems A recent product testi...
1. First, understand the overflow-wrap attribute ...