Skip to content

A simple Python script to completely remove all contents of the macOS Caches directory. Helps free up space and resolve potential issues caused by cached files.

License

Notifications You must be signed in to change notification settings

pedrorcruzz/nuke-macOS-caches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuke-macOS-caches

A simple Python script to completely remove all contents of the macOS Caches directory. Helps free up space and resolve potential issues caused by cached files.

Features

  • Deletes all files and folders inside ~/Library/Caches
  • Automatically detects the user’s home directory
  • Simple and lightweight, no dependencies required
  • Safe execution with exception handling

Installation

Clone the repository:

git clone https://git.1-hub.cnpedrorcruzz/nuke-macOS-caches.git
cd nuke-macOS-caches

Usage

Run the script using Python:

make run

Alternatively, you can create an alias in your .zshrc for easier execution:

echo "alias ccache='pushd \"\$(pwd)\" > /dev/null && cd ~/your-path/nuke-macOS-caches && make run && clear && popd > /dev/null'" >> ~/.zshrc
source ~/.zshrc
ccache

You can also use a shell script to execute the command:

echo '#!/bin/bash
cd ~/your-path/nuke-macOS-caches
make run
sleep 1.3
clear' > ~/path/your-scripts/clear-cache.sh
chmod +x ~/path/your-scripts/clear-cache.sh

You can create alias in your zshrc for script:

echo "alias ccache='pushd \"\$(pwd)\" > /dev/null && cd ~/path/your-scripts && ./clear-cache.sh && popd > /dev/null'" >> ~/.zshrc
source ~/.zshrc
ccache

Warning

This script permanently deletes all files in ~/Library/Caches. Use it with caution.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple Python script to completely remove all contents of the macOS Caches directory. Helps free up space and resolve potential issues caused by cached files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published