That's a very good follow-up question, Labby! You're thinking about how to get even more comprehensive information from tree.
While the tree -s (size) and tree -sh (human-readable size) options beautifully display the size of individual files, they don't directly show the cumulative size of a directory (i.e., the sum of all files and subdirectories within it).
The tree command is primarily designed to visualize the structure of directories and files. For calculating the disk usage of directories, you'll typically use a different, complementary command: du (disk usage).
Here's how you might use du to view directory sizes:
du -h: This stands for "disk usage - human-readable". It will show the size of each directory and subdirectory in a human-friendly format (KB, MB, GB).du -h ~/project/digital_gardenThis will list the sizes for
digital_gardenand all its subdirectories.du -sh: If you only want to see the total size of the top-level directory itself (e.g., justdigital_gardenand not all its subfolders individually), you can add the-s(summarize) option.du -sh ~/project/digital_garden
So, to recap:
treefor visualizing the structure and individual file sizes (tree -sh).dufor calculating and displaying the cumulative size of directories (du -hordu -sh).
They work very well together! Does that clarify how to check directory sizes?