Files used by mount
This will list directories in (reverse) size order
# du -k -S -x / | sort -r -n
Note:
-
-S
says it shouldn't include subdirectory counts, so each directory digit will be used which , rather than below the tree -
-x
indicates that it does not leave this filesystem. Without this, it will go into/proc
,/dev
,/sys
and so on, and you do not needdu
those.
EDIT: doh! doesn't mean -max-depth = 1 is just habit!
source to share
You can use find
to find the largest files on your system, for example:
find / -size 100M -print
Find and print the names of all files 100 MB or larger. You can use the option -mount
if you only want to look in the section where the specified directory is located:
find / -mount -size 100M -print
source to share
Often it is not the size of a single file, but what is contained in subdirectories. I usually use the parameter --max-depth=1
for du
to find "large directories" in my home
. Everything outside home
is installed in some way, so I can go to the package manager and show all installed packages sorted by disk size; then I can throw away some things that I no longer need.
source to share