有一个工具可以做到这一点:autotrash
\npip3 install --user autotrash\nRun Code Online (Sandbox Code Playgroud)\n(不再有 apt install)一个 cron 作业
\n@daily ./home/rinzwind/.local/bin/autotrash -td 10\nRun Code Online (Sandbox Code Playgroud)\n每天会删除一次您的垃圾。删除-d超过 10 天的文件。添加-t将为所有用户删除。它还有更多功能(例如根据条目和文件大小或垃圾箱中当前可用的内容进行删除)。
还有trash-cli
\nsudo apt install trash-cli\nRun Code Online (Sandbox Code Playgroud)\n和
\n@daily /usr/bin/trash-empty\nRun Code Online (Sandbox Code Playgroud)\n每天会删除垃圾一次。
\n$ pip3 install --user autotrash\nCollecting autotrash\n Downloading autotrash-0.4.1-py3-none-any.whl (22 kB)\nCollecting arrow<0.18.0,>=0.17.0\n Downloading arrow-0.17.0-py2.py3-none-any.whl (50 kB)\n |\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 50 kB 2.2 MB/s \nRequirement already satisfied: python-dateutil>=2.7.0 in /usr/lib/python3/dist-packages (from arrow<0.18.0,>=0.17.0->autotrash) (2.8.1)\nInstalling collected packages: arrow, autotrash\n WARNING: The script autotrash is installed in '/home/rinzwind/.local/bin' which is not on PATH.\n Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\nRun Code Online (Sandbox Code Playgroud)\n和 ...
\nrinzwind@discworld:~/.local/bin$ ./autotrash -td 10\nrinzwind@discworld:~/.local/bin$ \nRun Code Online (Sandbox Code Playgroud)\n