A shell script to easily delete dependency folders in a given directory and its subdirectories. A great tool to free up disk space by removing unnecessary node_modules, .cache, pycache, target, venv, env, go/pkg folders.
- 🔎 Recursively searches for the following folders in the input directory: "node_modules", ".cache", "pycache". "target", "venv". "env", "go/pkg" (any of them can be added or removed)
- 📊 Displays the total size of each folder
- 💽 Calculates the total space saved
- 🖥️ Works on Linux and MacOS
The script can be executed using the following command in the terminal:
./dependency-cleaner.sh [directory_path] [max_depth]
directory_path
: Required. The directory to search for node_modules folders.max_depth
: Optional. Sets maximum depth to search for node_modules folders. Default is 3.
If you have any suggestions for improvements or find any bugs, feel free to open a pull request or an issue.
- Oleg Kron - olegkron
This project is licensed under the MIT License - see the LICENSE file for details.