fbpx

Ubuntu Disk Space Occupied

person on top of a hill

When you run low on space on your disks and you don’t know what is going, then you should start investigating to see what files you can remove.

If you want to check how much space is left in your Ubuntu server then you can use this command:

/var/www# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 27G 7.9G 17G 32% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 205M 1.8G 11% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda2 10G 2.1G 7.4G 22% /home
tmpfs 393M 0 393M 0% /run/user/0
/var/www#

The command above gives you a global overview, but if you want to dig deeper to get more details then follow the next section.

If you want to check the space occupied by each folder then this is the command you need

/var/www# du -h --max-depth=1