Thursday, 23 January 2020

What's been eating my disk ?

I'm sure I've posted this before, but repetition is the most sincere form of .... something deep and meaningful.

Want to see what's eating your disk in a particular file-system ?

Try: -

du -hs * | sort -h

against, say, /home to see who is eating your disk, especially in terms of specific user's home directories etc.

3 comments:

  1. That is a great idea if you cannot install other tools.
    But there is actually a simple and nice tool called "ncdu".

    It's part of epel in RHEL/CentOS.

    ncdu gives you a list you can navigate :-)

    -- Daniel Nashed

    ReplyDelete
  2. Hi Daniel

    Thanks for this. Will see whether that exists on Ubuntu as well.

    Cheers. Dave

    ReplyDelete
  3. Daniel

    Yep, as you rightly suggested ...

    apt-get install -y ncdu

    dpkg --list|grep ncdu

    ii ncdu 1.11-1build1 s390x ncurses disk usage viewer

    ncdu -help

    ncdu

    -h This help message
    -q Quiet mode, refresh interval 2 seconds
    -v Print version
    -x Same filesystem
    -r Read only
    -o FILE Export scanned directory to FILE
    -f FILE Import scanned directory from FILE
    -0,-1,-2 UI to use when scanning (0=none,2=full ncurses)
    --si Use base 10 (SI) prefixes instead of base 2
    --exclude PATTERN Exclude files that match PATTERN
    -X, --exclude-from FILE Exclude files that match any pattern in FILE
    --exclude-caches Exclude directories containing CACHEDIR.TAG

    Thanks again !

    ReplyDelete