Autotrash: a command line tool for removing junk

trash can background

If you are looking for a command line tool that can be used to remove old files from the trash and thus remove the garbage from your GNU / Linux distribution, autotrash is the tool you were looking for. With it you will not have to be aware of cleaning or emptying the trash of your graphic environment every time you see it full. You will not have to check if the trash icon indicates that it is empty or full, because autotrash will do it periodically for you in a fully automated way so that you can dedicate yourself to other things.

That is, autotrash is a utility that allows you to purge old files that have been deleted by you and that have remained inside the recycle bin for a specified number of days that you can specify. After the established period of time, the tool will start up and delete the contents of the directory from the trash. Remember that in Linux environments it is usually stored in ~ / .Trash or other paths such as ~ / .local / share / Trash / files. It is there where all the deleted files that you have sent to the trash when you have not yet left it empty are housed.

The autotrash package is not rare, so you can find it in any repo of the most popular distros. So you can install using the package manager that you use frequently, for example with a sudo apt-get install autotrash would be enough in Debian and derivatives ... To program the tool to read temporary information about the trash in ~ / .local / share / Trash / info, you can use the following command , which would delete or empty the trash every month (30 days):

autotrash -td 30

If you don't use the -t option, and you only use -d, then they are only removed for the current user and not for all users. You can even use the –max-free or –min-free options to remove depending on the space maximum or minimum remaining on the partition where the trash can is housed. For example:

autotrash --max-free 2048 --min-free 1024 -d 30

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

A comment, leave yours

Leave a Comment

Your email address will not be published.



  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Inukaze said

    It will surely format the hard drive if it detects Ubuntu or any of its derivatives installed xD or if it detects Mac OS X or if it detects Microsoft Windows ME, Vista, 8, 8.1 or 10 xD