How to find the largest directories or largest files?
A utility called ncdu
will give you the information you are looking for.
sudo apt-get install ncdu
On OS X, it can be installed using Homebrew:
brew install ncdu
Following command shows you one level of directories and their sizes
du --max-depth=1 /path | sort -r -k1,1n
If one of them really sticks out (the last one on the list is the largest due to sort -r
), then you re-run the command on that directory, and then keep going until you find the offending directory / file.
If all you want is the ten biggest files just do
find /home -type f -exec du -s {} \; | sort -r -k1,1n | head
From any directory:
du -a | sort -n -r