A modern, interactive wrapper for macOS's locate database updater with real-time stats, disk health monitoring, and a beautiful CLI interface.
macOS includes a powerful locate command for finding files instantly, but its database only updates once per week (Saturdays at 3:15 AM). If you're actively developing, installing packages, or managing files, your searches return stale results.
Running the raw update command (sudo /usr/libexec/locate.updatedb) gives you zero feedback—just a blank terminal for 20-60 seconds.
locate-update solves both problems:
- Update on demand whenever you need fresh results
- See exactly what's happening with animated progress, stats, and health metrics
╭────────────────────────────────────────────────────────────╮
│ 🔍 Locate Database Update │
╰────────────────────────────────────────────────────────────╯
✦ Current State
╭────────────────────────────────────────────────────────────╮
│ Last indexed: 2025-11-20 14:59 (2h ago) │
│ Files indexed: 1,197,645 │
╰────────────────────────────────────────────────────────────╯
✦ Disk Health
╭────────────────────────────────────────────────────────────╮
│ Capacity: 1.8 TB │
│ Used: 505.8 GB (27%) │
│ Free: 1.3 TB (73%) │
│ Status: Healthy │
│ SMART: Verified │
╰────────────────────────────────────────────────────────────╯
✦ Indexing
Press n new files │ s dir sizes
⠹ Cataloging your Downloads folder chaos... (12s)
- Real-time progress with animated spinner and elapsed time
- Disk health dashboard showing capacity, usage, and SMART status
- Delta tracking - see how many files changed since your last update
- Interactive options during indexing:
- Press
nto see recently created files - Press
sto see top directories by size
- Press
- Beautiful CLI with box-drawing characters and color coding
# Download the script
curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/locate-update/main/locate-update -o /usr/local/bin/locate-update
# Make it executable
chmod +x /usr/local/bin/locate-update# Clone the repository
git clone https://github.com/YOUR_USERNAME/locate-update.git
cd locate-update
# Copy to your PATH
cp locate-update /usr/local/bin/
chmod +x /usr/local/bin/locate-updateIf you prefer user-local installation:
# Create directory if needed
mkdir -p ~/.local/bin
# Copy script
cp locate-update ~/.local/bin/
chmod +x ~/.local/bin/locate-update
# Add to PATH (add this to your ~/.zshrc or ~/.bashrc)
export PATH="$HOME/.local/bin:$PATH"Simply run:
locate-updateYou'll be prompted for your password (required for sudo).
While indexing is running:
n- Show recently created files (since last index)s- Show top 5 directories by disk usage
Use the locate command to find files instantly:
# Find all Python files
locate .py
# Find a specific config file
locate nginx.conf
# Case-insensitive search
locate -i readme- macOS (tested on Sonoma/Sequoia)
- Bash 3.2+ (included with macOS)
- Admin privileges (for
sudo)
- Authenticates with
sudoupfront (no password prompt during animation) - Shows current index state and disk health
- Runs
/usr/libexec/locate.updatedbin background - Displays animated progress with rotating messages
- Tracks file count delta between runs (stored in
~/.cache/locate-update-stats) - Reports results with new totals
- Database location:
/var/db/locate.database - macOS default update schedule: Weekly via
/etc/periodic/weekly/310.locate - Typical index time: 15-45 seconds depending on disk size and file count
MIT License - see LICENSE for details.
Contributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
Built with caffeine and the desire to never stare at a blank terminal again.