How does one list all directories, and see the space each directory takes up on your disk, in a given directory?
I rarely need this, but I do find myself having to Google it each time I do ...
So for my own reference, and maybe for others as well:
(works in a Linux Shell or macOS Terminal)
du -sh /path/to/directory/*
This will list all directory in "/path/to/directory/", with it's size.
For example:
~ $ du -sh /Users/username/* 12:25
30M /Users/username/Applications
1.3M /Users/username/Applications (Parallels)
24M /Users/username/Creative Cloud Files
1.1G /Users/username/Desktop
235G /Users/username/Documents
18G /Users/username/Downloads
12K /Users/username/Fusion 360
129G /Users/username/Library
144K /Users/username/Movies
1M /Users/username/Music
1.3M /Users/username/untitled folder
Explanation
"du" (disk usage) command estimates the space usage. Note: only for directories you have access to!!!
The Linux Man page and Apple man page can give you more details.
The options we use here: -sh
-s, --summarize; display only a total for each argument
-h, --human-readable; print sizes in human readable format (e.g., 1K 234M 2G)
Optional:
-c, --total; produce a grand total