unfortunately if you would use du -h (for human readable) you lose the “sort for size” mechanism.

what harddisk/partition is full?

df -h; # report file system disk space usage
Filesystem              Size  Used Avail Use% Mounted on
devtmpfs                3.9G     0  3.9G   0% /dev
tmpfs                   3.9G   42M  3.9G   2% /dev/shm
tmpfs                   3.9G  9.0M  3.9G   1% /run
tmpfs                   3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda3                50G   28G   23G  56% /
/dev/sda1              1014M  455M  560M  45% /boot
/dev/sda2                99G   69G   25G  74% /home
/dev/sda6                79G   50G   26G  67% /run/media/projects
tmpfs                   788M     0  788M   0% /run/user/0

manpage: df.man.txt

why is a particular harddisk/partition full?

you just see what is the largest – but not exactly how large.

# list 30 biggest files or directories (qnap tested)
du -a / | sort -n -r | head -n 30;

# another variant
du -sx /* | sort -rh | head -30;

# if you wanna know the size of a single directory in h-uman readable form you would have to use
du -h --max-depth=0 ./directory

# you could create an alias for that
alias size_of="du -h --max-depth=0 "

# what user is using how much harddisk space?
du -h --max-depth=0 /home/*
16K     /home/lost+found
20K     /home/maria
773M    /home/user

manpage: du.man.txt

Links:

GNU Linux (Debian) – how to – find the largest 30 duplicate files wasting disk space – multi line sorting madness (mlsm) – how to output x blocks of text separated by delimiter – build (Bill Poser’s and BSDs) msort from src

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin