Files
nas-tools/find_large_files.sh
T

80 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
# Find Large Files - Help locate where space is actually being used
set -e
echo "=== Find Large Files ==="
echo ""
echo "Your container is 99.8% full (493.5GB used, 847MB free)"
echo "Let's find where the space is actually being used..."
echo ""
echo "📊 Top Space Users:"
echo ""
echo "Home directory breakdown:"
du -h -d 1 ~ 2>/dev/null | sort -hr | head -10 | awk '{printf " %8s %s\n", $1, $2}'
echo ""
echo "🔍 Large Files (>1GB) in Home:"
echo " Searching... (this may take a moment)"
find ~ -size +1G -type f 2>/dev/null | head -10 | while read file; do
SIZE=$(du -h "$file" 2>/dev/null | awk '{print $1}')
echo " $SIZE $file"
done
echo ""
echo "📁 Large Directories in Documents (40GB):"
du -h -d 1 ~/Documents 2>/dev/null | sort -hr | head -10 | awk '{printf " %8s %s\n", $1, $2}'
echo ""
echo "📚 Large Directories in Library (33GB):"
du -h -d 1 ~/Library 2>/dev/null | sort -hr | head -10 | awk '{printf " %8s %s\n", $1, $2}'
echo ""
echo "💾 Other Large Locations:"
echo " .local: $(du -sh ~/.local 2>/dev/null | awk '{print $1}')"
echo " .ollama: $(du -sh ~/.ollama 2>/dev/null | awk '{print $1}')"
echo " Downloads: $(du -sh ~/Downloads 2>/dev/null | awk '{print $1}')"
echo ""
echo "=== Questions ==="
echo ""
echo "1. Where exactly did you delete the 20GB from?"
echo " - Was it from ~/Movies? (currently 6.7GB)"
echo " - Or another location?"
echo ""
echo "2. Did you verify the files were actually deleted?"
echo " - Check the original location"
echo " - Check Trash (currently empty)"
echo ""
echo "3. The container shows 493.5GB used:"
echo " - Data volume: 471.8GB"
echo " - System volume: 12.2GB"
echo " - Preboot: 8.1GB"
echo " - Recovery: 1.2GB"
echo ""
echo " Your home directory is 130GB, but the Data volume is 471.8GB"
echo " This means there are other users or system files using space."
echo ""
echo "=== Recommendations ==="
echo ""
echo "To free space immediately:"
echo ""
echo "1. Clean Downloads: $(du -sh ~/Downloads 2>/dev/null | awk '{print $1}')"
echo " rm -rf ~/Downloads/*"
echo ""
echo "2. Clean Library Caches:"
echo " rm -rf ~/Library/Caches/*"
echo ""
echo "3. Review Documents folder (40GB):"
echo " Move large files to NAS"
echo ""
echo "4. Review .ollama folder (17GB):"
echo " Remove unused AI models"
echo ""
echo "5. Use macOS Storage Management:"
echo " Apple Menu → About This Mac → Storage → Manage"
echo ""