1. MagicESP
  2. Ubuntu Server 18.04
  3. Show the Folders Size

Show the Folders Size

Synonyms:
  1. du

This is how to find the largest folders that eat the disk space.

Disk Space Measure

sudo apt install ncdu
sudo ncdu /

Sort the folders according to size and display them in human readable format, largest first.

du -s {{ path.value }}/* | sort -nr| cut -f 2-|xargs -i du -sh {}
sudo du -s ./* | sort -nr| cut -f 2-|xargs -i sudo du -sh {}

Some alternative commands

du -hs {{ path.value }}/*
du -h --max-depth=1 {{ path.value }}
du -sk {{ path.value }}