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's a command to list all directories sorted by size with their full paths:
du -hd 1 / 2>/dev/null | sort -hrHowever, this will try to scan your entire system. For a more practical approach, you can scan from your home directory:
du -hd 1 ~/* 2>/dev/null | sort -hrOr to recursively find all directories and sort them by size:
du -h -d 0 ~/*/ 2>/dev/null | sort -hrFor a more comprehensive scan that includes subdirectories at any depth:
find ~ -type d -exec du -sh {} + 2>/dev/null | sort -hrIf you want to limit the output to see just the largest directories, you can pipe it to :
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.