A cleanup script to clear caches and logs in Fedora (Tested in Fedora 43 Workstation). Prints the components cleared in the terminal along with the total storage recovered. Also logs every cleanup with a timestamp.
git clone https://github.com/Infiniti151/fedora-cleanup.git
cd fedora-cleanup
chmod +x ./clean.sh
./clean.sh
This script cleans the following:
- Thumbnails cache ($HOME/.cache/thumbnails)
- Pip cache ($HOME/.cache/pip)
- Microsoft Edge cache ($HOME/.cache/microsoft-edge/Default/Cache/Cache_Data, $HOME/.cache/microsoft-edge/Default/Code Cache/js, $HOME/.config/microsoft-edge/Default/Service Worker/CacheStorage, $HOME/.config/microsoft-edge/Default/Service Worker/ScriptCache, $HOME/.config/microsoft-edge/Default/IndexedDB, $HOME/.config/microsoft-edge/Default/load_statistics.db, /opt/microsoft/msedge/locales)
- VS Code cache ($HOME/.config/Code/CachedExtensionVSIXs, $HOME/.config/Code/Cache/Cache_Data, $HOME/.config/Code/User/workspaceStorage, $HOME/.config/Code/CachedData, $HOME/.config/Code/GPUCache)
- Firefox cache ($HOME/.cache/mozilla/firefox/*/cache2/entries)
- LibreWolf cache ($HOME/.cache/librewolf/*/cache2/entries)
- Wine cache ($HOME/.cache/wine)
- GLCache ($HOME/.cache/nvidia/GLCache)
- Akmods cache (/var/cache/akmods)
- DNF5 cache (/var/cache/libdnf5)
- Coredumps (/var/lib/systemd/coredump)
- Journal logs (/var/log/journal)
- Nvidia nsight-compute (/opt/Nvidia/nsight-compute/xxxx.x.x)
- Nvidia nsight-systems (/opt/Nvidia/nsight-systems/xxxx.x.x)
- Nvidia CUDA (/usr/local/cuda-xx.x)
- Needs to be run as sudo to delete files in /var, /opt, and /usr
- Logs are stored in $HOME/clean.log
- For CUDA, nsight-systems, and nsight-compute, the script deletes older version folders and only keeps the latest version

