Linux – How to Pin Point Large File eating space in Fedora 18

disk-usagelinux

I can't determine exactly what file is eating up my disk.

Firstly I used df command to list my directories:

devtmpfs                 16438304        0  16438304   0% /dev
tmpfs                    16449868        0  16449868   0% /dev/shm
tmpfs                    16449868  1637676  14812192  10% /run
tmpfs                    16449868        0  16449868   0% /sys/fs/cgroup
/dev/mapper/fedora-root  51475068 38443612  10393632  79% /
tmpfs                    16449868      384  16449484   1% /tmp
/dev/sda3                  487652    66874    391082  15% /boot
/dev/mapper/fedora-home 889839636 44677452 799937840   6% /home

Then I ran du -h / | grep '[0-9\,]\+G'.

The problem is I get everything including other directories,
so I need to get specifically find /dev/mapper/fedora-root
but when I try du -h /dev/mapper/fedora-root | grep '[0-9\,]\+G' I get no results.

I need to know what's eating up 79% of directory /

How can I solve this?

Best Answer

My magic command in such situation is :

du -m . --max-depth=1 | sort -nr | head -20

To use this :

  1. cd into the top-level directory containing the files eating space. This can be / if you have no clue ;-)
  2. run du -m . --max-depth=1 | sort -nr | head -20. This will list the 20 biggest subdirectories of the current directory, sorted by decreasing size.
  3. cd into the biggest directory and repeat the du ... command until you find the BIG file(s)
Related Question