Disk Cleanup / Space Freeing

Windows

Windows app for seeing what is using space

choco install windirstat

Windows app for ACTUALLY removing old software https://www.revouninstaller.com/products/revo-uninstaller-free/

Powershell Cleanup Temp Directories script

# PowerShell script to clear temporary directories
# Deletes all files and subdirectories but preserves the parent directories

$ErrorActionPreference = "Continue"

# Define the directories to clear
$tempDirs = @(
    "C:\WINDOWS\Temp",
    "C:\users\piegarden\AppData\Local\Temp"
)

foreach ($dir in $tempDirs) {
    if (Test-Path $dir) {
        Write-Host "Clearing: $dir" -ForegroundColor Yellow
        
        try {
            # Get all items in the directory
            $items = Get-ChildItem -Path $dir -ErrorAction SilentlyContinue
            
            if ($items) {
                # Delete all files and subdirectories
                $items | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
                Write-Host "  Successfully cleared: $dir" -ForegroundColor Green
            } else {
                Write-Host "  Directory is already empty: $dir" -ForegroundColor Gray
            }
        }
        catch {
            Write-Host "  Error clearing $dir : $_" -ForegroundColor Red
        }
    }
    else {
        Write-Host "Directory does not exist: $dir" -ForegroundColor Red
    }
}

Write-Host "`nCleanup complete!" -ForegroundColor Cyan

Docker

Remove all the old stuff

sudo docker rm -v $(sudo docker ps -a -q -f status=exited) || true       
sudo docker rmi -f  $(sudo docker images -f "dangling=true" -q) || true       
sudo docker system prune -a -f       
sudo docker volume ls -qf dangling=true | xargs -r docker volume rm || true