File System Disk Space Usage

663 Views Asked by At

When I use the unix df command to return the disk usage, I get the following reported

/dev/sda1                       30929148 30530112    399036  99% /

How get what is using the disk space.

Is there a way to determine as to which directories are taking up space?

1

There are 1 best solutions below

6
On

You can using du (disk usage). For example:

➜  ~ du -sh /usr/* 2>/dev/null 
587M    /usr/bin
276M    /usr/include
5,4G    /usr/lib
444M    /usr/lib32
0       /usr/lib64
96K     /usr/local
0       /usr/sbin
3,1G    /usr/share
4,0K    /usr/src

To sort use sort -h.

Edit

Works with directories (which can be mountpoints).

du -sh $(lsblk -no MOUNTPOINT /dev/sda1)/* 2>/dev/null