/dev/md1 6068992 5204648 551080 91% /
I have 91% taken and am trying to discover what files are taking up space. I'm using linux. Does any one know the command?
thanks
/dev/md1 6068992 5204648 551080 91% /
I have 91% taken and am trying to discover what files are taking up space. I'm using linux. Does any one know the command?
thanks
du -k -S -x / | sort -n -r | head -10
Will return the 10 largest files on the root file system.
Edit: @Alnitak's answer included the -S
and -x
, included here for completeness.
This will list the directories in (reverse) order of size
# du -k -S -x / | sort -r -n
Note:
-S
tells it not to include subdirectory counts, so each directory figure will be the use of that directory, not the tree below it-x
tells it not to leave that file system. Without this it'll go into /proc
, /dev
, /sys
, etc, and you don't need to du
those.EDIT: doh! didn't mean the --max-depth=1 - just force of habit!
You can use find
to locate the largest files on your system, for example:
find / -size 100M -print
Will find and print the names of all files that are 100 MB or larger. You can use the -mount
option if you only want to look in the partition that the specified directory resides on:
find / -mount -size 100M -print
This seems like a dupe of Tracking down where disk space has gone on Linux?
Often it is not the size of a single file but what is contained in the subdirectories. I usually use the --max-depth=1
option to du
to find the "big directories" in my home
. Everything outside of home
is installed in some way, so I can go to my package manager and let it show all installed packages, sorted by disk size; then I can throw out some things I do not need anymore.