give me a mac terminal command to sort all my directories by size and give me the path…
- User
give me a mac terminal command to sort all my directories by size and give me the path to each
- Assistant
Here are a couple of one-liners you can run in your Mac’s Terminal. They’ll walk a given directory tree, measure each sub-directory’s size, then sort by size (largest first) and print the full path.
- “Quick & dirty” (recurses every subdir):
du -h /path/to/parent | sort -hr• du -h → show sizes in human-readable form (e.g. “1.2G”, “450M”)
• sort -h -r → sort by human sizes, reverse (largest first)- More controlled (only 1 level deep):
du -h -d 1 /path/to/parent | sort -hr
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.