https://github.com/pedrorcruzz/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.
https://github.com/pedrorcruzz/nuke-macos-caches
caches clear macos nuke python
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/pedrorcruzz/nuke-macos-caches
- Owner: pedrorcruzz
- License: mit
- Created: 2025-03-04T18:33:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-04T19:25:53.000Z (3 months ago)
- Last Synced: 2025-03-04T19:34:36.597Z (3 months ago)
- Topics: caches, clear, macos, nuke, python
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```sh
git clone https://github.com/pedrorcruzz/nuke-macOS-caches.git
cd nuke-macOS-caches
```## Usage
Run the script using Python:
```sh
make run
```Alternatively, you can create an alias in your .zshrc for easier execution:
```sh
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:```sh
echo '#!/bin/bash
cd ~/your-path/nuke-macOS-caches
make run
sleep 1.3
clear' > ~/path/your-scripts/clear-cache.sh
```
```sh
chmod +x ~/path/your-scripts/clear-cache.sh
```You can create alias in your zshrc for script:
```sh
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](LICENSE) file for details.