In Linux (Debian, Ubuntu, CentOS, etc.), there are several universal tools for this.
The main tool for disk space analysis is, of course, df.
The most common usage:
df -h
[root@server ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda3 58G 6.3G 48G 12% / tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/xvda1 194M 117M 68M 64% /boot
Another very important usage:
df -i
[root@server ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/xvda3 3726848 309625 3417223 9% / tmpfs 181859 1 181858 1% /dev/shm /dev/xvda1 51200 62 51138 1% /boot
How to find which folder takes up the most space?
To do this, you can use the ncdu utility for analyzing space usage by individual folders.Alternatively, you can do it manually (get a list of all subfolders starting from the current location, sorted in descending order of their size in megabytes):
du -shm * | sort -nr
du -sh * | sort -nr