How to Pin Point Large File eating space in Fedora 18
My magic command in such situation is :
du -m . --max-depth=1 | sort -nr | head -20
To use this :
cd
into the top-level directory containing the files eating space. This can be/
if you have no clue ;-)- 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. cd
into the biggest directory and repeat thedu ...
command until you find the BIG file(s)
ncdu
is a great tool for this kind of problem. Here's the corresponding package.
You can use -x
if you want to stay on only one filesystem, without following symlinks. For example, as root:
ncdu -x /home
It's the command line equivalent of DaisyDisk, Baobab or WinDirStat.
It might take a long time to scan a large folders, but once it's done it should be very fast to find the largest files.
If you have a feel for the actual size of the file you can find
files larger than a specific size.
Eg, to find files larger than 10 MiB:
find /mounted/drive -size +10M
Or
find /mounted/drive -size +10M -exec ls -lh {} +
Httqm's suggestion is also good if the problem isn't one big file but a large collection of smaller files. That is use du
to show directory totals. Limiting with --max-depth
is very useful with large directory trees:
du -m some/directory --max-depth=1 | sort -nr | head -20
du some/directory --max-depth=1 | sort -n | tail -21
Will break a single directory down into sub-directories, the second of these gives you the total for the directory you're listing as well.