"Somebody had to, right?"
A cross-platform .NET global tool that recursively deletes bin and obj folders from your current directory. Perfect for cleaning up .NET projects and freeing disk space.
- 🚀 Fast & Efficient: Quickly finds and removes all bin/obj folders recursively
- 🌍 Cross-Platform: Works on Windows, Linux, and macOS
- 🛡️ Safe: Asks for confirmation before deletion (can be skipped with
-y) - 🔍 Dry-Run Mode: Preview what would be deleted without actually deleting
- 💪 Robust Error Handling: Gracefully handles file locks, permission issues, and other errors
- 📊 Detailed Summary: Shows how many folders were deleted and how much space was freed
Install as a global .NET tool:
dotnet tool install -g DeepCleanUpdate to the latest version:
dotnet tool update -g DeepCleanUninstall:
dotnet tool uninstall -g DeepCleanNavigate to the root directory of your .NET solution or project(s) and run:
deepclean| Option | Description |
|---|---|
-d, --dry-run |
Preview what would be deleted without actually deleting |
-y, --yes |
Skip confirmation prompt and delete automatically |
-h, --help |
Show help message |
Preview what would be deleted:
deepclean --dry-runDelete without confirmation:
deepclean --yesInteractive mode (default):
deepcleanThis will show you all the folders to be deleted and ask for confirmation.
DeepClean - Recursively delete bin and obj folders
==================================================
Starting directory: /home/user/projects/MyApp
Found 4 folder(s) to delete:
- /home/user/projects/MyApp/src/MyApp.Api/bin
- /home/user/projects/MyApp/src/MyApp.Api/obj
- /home/user/projects/MyApp/src/MyApp.Core/bin
- /home/user/projects/MyApp/src/MyApp.Core/obj
Do you want to delete these folders? (y/n): y
Deleting folders...
✓ Deleted: /home/user/projects/MyApp/src/MyApp.Api/bin
✓ Deleted: /home/user/projects/MyApp/src/MyApp.Api/obj
✓ Deleted: /home/user/projects/MyApp/src/MyApp.Core/bin
✓ Deleted: /home/user/projects/MyApp/src/MyApp.Core/obj
Summary:
Deleted: 4 folder(s)
Freed space: 1.23 GB
DeepClean handles various error scenarios gracefully:
- File Locks: If files are locked by another process, the error is reported but the tool continues
- Permission Issues: If you don't have permission to delete a folder, it's reported as an error
- Path Length Issues: Handles long paths that exceed OS limitations
- Access Denied: Reports directories that require elevation or special permissions
All errors are collected and displayed at the end of execution.
git clone https://github.com/matt-goldman/deepclean.git
cd deepclean/DeepClean
dotnet build
dotnet run -- --helpTo create a NuGet package:
dotnet pack -c ReleaseThe GitHub Actions workflow automatically publishes to NuGet when a release is created.
MIT License - see LICENSE for details