/system-cache-prune

Clear caches from the system

Primary LanguageShellMIT LicenseMIT

system-cache-prune

Clear caches from the system.

This tool is intended to cleanup various caches on machine where free disk availability is regularly critical.

I got tried of remembering which command does the cleanup, is it

  • yarn cache-clear, yarn clear-cache, yarn clear cache?
  • composer clean cache?

so I wrote this script and polished it.

Usage

$ system-cache-prune.sh
$ system-cache-prune.sh subsystem1 subsystem2

Subsystems

  • brew: Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae.
  • composer: Deletes all content from Composer's cache directories.
  • docker: Remove all unused containers, images (both dangling and unreferenced).
  • npm: Delete all data out of the cache folder.
  • yarn: Remove the shared cache files.
  • docker:disk-image: Compact Docker.raw or Docker.qcow2 to return space to the OS.