Files used by mount

/ dev / md1 6068992 5204648 551080 91% /

I have 91% and I am trying to figure out which files are taking up space. I am using linux. Anyone know the command?

thank

+1


source to share


5 answers


du -k -S -x / | sort -n -r | head -10

Will return the 10 largest files to the root filesystem.



Edit: @ Alnitak's answer has included -S

and -x

included here for completeness.

+9


source


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 need du

    those.

EDIT: doh! doesn't mean -max-depth = 1 is just habit!

+9


source


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

      

+1


source


I usually use:

du -x / | sort -ns

      

But when in GUI you can also use filelight or fsview .

0


source


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.

0


source







All Articles