简体   繁体   中英

File System Disk Space Usage

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM