How to show disk usage in each subdirectory in Linux?
I have a directory /var/lib/docker
that contains several subdirectories:
/var/lib/docker$ sudo ls
aufs containers image network plugins swarm tmp trust volumes
I would like to know how big each directory is. However, using the command du
as below,
/var/lib/docker$ sudo du -csh .
15G .
15G total
I don't see a "breakdown" for each directory. In the examples I've seen at http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ , it looks like I should see this. How can I get this overview to see which directory is taking up the most space?
source to share
Try using an argument max-depth
. It prints the total disk space usage for a directory (or file using --all
) only if it is less N
or less than the levels below the command line argument.
For example, the following command will show disk space up to 3 deep subdirectories
du --max-depth=3 -h
For information on N-levels use du --max-depth=N -h
, where N is a positive integer.
source to share