Linux-Tech-Tips/README.md

11 lines
638 B
Markdown
Raw Normal View History

2022-02-05 13:09:09 +01:00
# Random Linux Tips
2022-02-05 13:17:41 +01:00
## 1. Automatically clear cache.
2022-02-05 13:18:32 +01:00
- Description: Move files older than a specific amount of time from your user's ~/.cache directory to the trash.
2022-02-05 13:32:34 +01:00
- Requires: [https://github.com/PhrozenByte/rmtrash](rmtrash).
2022-02-05 13:18:32 +01:00
- How-To:
2022-02-05 13:32:34 +01:00
- Add the following line to your crontab using the command "crontab -e" (or EDITOR=$editor crontab -e):
$ 0 17 * * * /usr/bin/find ~/.cache/* -mtime +7 -exec /usr/bin/rmtrash -rf {} \;
- This command looks at files in ~/.cache every day at 5 p.m. and moves files older than 7 days to the trash.
- Additionally: This can also be done using regular "rm" instead of "rmtrash".