Skip to content

This code goes through any disk, after confirmation, and lists the top 20 largest files. It is very helpful on Mac, because MacOS hides a lot of files from their Storage options in Settings.

License

Notifications You must be signed in to change notification settings

danielalanbates/Sort_mac_files_by_size

Repository files navigation

Sort mac files by size

A small macOS Python CLI utility to scan a directory and list the largest files. Dry-run by default; use --do-move --i-understand to perform moves.

Usage examples

  • List top 20 files in a directory (interactive picker if no path):
python sort_files_by_size.py /path/to/scan --limit 20 ## GUI & macOS app This repository now includes a simple Tkinter GUI wrapper (`gui_sort_files.py`) and helper files to produce a macOS `.app` bundle. - Run the GUI directly from source: ```bash python3 gui_sort_files.py
  • Double-click launcher (macOS):

Make run_gui.command executable once and then double-click it in Finder:

chmod +x run_gui.command # then double-click run_gui.command in Finder
  • Build a macOS .app with PyInstaller:

See BUILD_APP.md for full steps. A helper script build_app.sh automates icon conversion and the PyInstaller build.

  • CI: A GitHub Actions workflow (.github/workflows/build-macos-app.yml) is available on branch feature/build-app and will produce the .app as an artifact when run on a macOS runner.

  • Locally-built .app location (by default):

    • dist/SortFilesBySize/SortFilesBySize.app
    • You can copy it to /Applications or ~/Applications.

If you'd like a signed/notarized build or a single-file distribution, open an issue or request and I can add those steps.

 - Dry-run moving indices 1–3 to default destination: ```bash python sort_files_by_size.py /path/to/scan --move-index 1-3 
  • Actually move (dangerous — only when you understand consequences):
python sort_files_by_size.py /path/to/scan --move-index 1-3 --do-move --i-understand

Safety

  • The script will not perform moves unless both --do-move and --i-understand are provided.
  • Be careful when moving or deleting files. Keep backups.

About

This code goes through any disk, after confirmation, and lists the top 20 largest files. It is very helpful on Mac, because MacOS hides a lot of files from their Storage options in Settings.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published