> ## Content Index
> Fetch the complete content index at: https://kudithipudi.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# HOW TO : Find size of directories in current directory
- URL: https://kudithipudi.org/how-to-find-size-of-directories-in-current-directory/
- Published: 2012-03-06T15:02:45.000Z
- Updated: 2012-03-06T15:02:45.000Z
- Description: Quick note for self. Simple bash loop to find out the size of each directory in the existing directory. This script is useful if you are...
- Author: admin
- Tags: HOWTO, Linux, Uncategorized, #wp, #wp-post, #Import 2026-08-23 02:32

Quick note for self. Simple bash loop to find out the size of each directory in the existing directory. This script is useful if you are running our of disk space and want to quickly find out the offending directory.

```
for dir in $(find ./ -maxdepth 1 -type d); do echo ${dir}; du -ch ${dir} | grep -i total; done
```

Breaking this down

- The find command prints out a list of directories. You can modify it to do recursive lookups by just removing the -maxdepth option. This output is fed into the bash loop
- du gets the size of all the files (and sub directories) in the directory and grepping it for total gives you the total size of the directory