Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

du and df are nice, but I don't know how to filter the data they provide the way I do with SequoiaView. I would like to know which are the largest folders and the largest files in a glance.

share|improve this question

3 Answers 3

up vote 29 down vote accepted

Use some combination of the commands and options:

du --max-depth=1 2> /dev/null | sort -n -r | head -n20

to view only the largest few. If you'd like to use it a lot, then bind it to an alias, e.g. in bash by adding to ~/.bashrc

alias largest='du --max-depth=1 2> /dev/null | sort -n -r | head -n20'
share|improve this answer
1  
To view the largest few, you need the -r option on sort. –  RedGrittyBrick Jun 22 '11 at 13:23
    
I submitted @RedGrittyBrick suggestion and an error redirection to /dev/null as an edit subject to approval. –  Jader Dias Jun 22 '11 at 13:39
    
I would also use the du -H option, but it breaks the sort behavior –  Jader Dias Jun 22 '11 at 13:54
    
What does 2> do? –  jumpnett Jun 5 '13 at 21:40
1  
@jumpnett: it redirects standard error (in this case into the black hole that is /dev/null). –  eldering Jun 6 '13 at 21:46

You might also want to try the NCurses Disk Usage aka ncdu.

Use it like ncdu -x -q if you're invoking it remotely (e. g. via ssh) and ncdu -x otherwise.

ncdu 1.6 ~ Use the arrow keys to navigate, press ? for help
    --- /home/geek -----------------------------------------------------------------
       27.6MiB  /qm test 1 rework
      312.0kiB  /sidebar
       88.0kiB  /rackerhacker-MySQLTuner-perl-6add618
        8.0kiB  /.w3m
        4.0kiB  /.cache
    e   4.0kiB  /.ssh
      160.0kiB   ng.tar.gz
       76.0kiB   plowshare_1~svn1673-1_all.deb
        4.0kiB   .bashrc
        4.0kiB   .bash_history
        4.0kiB   .profile
        4.0kiB   .htoprc
        4.0kiB   .bash_logout
        0.0  B   .lesshst

This is available under Mac OS X too.

The following flags to the command line might be helpful:

-q Quiet mode, doesn't update the screen 10 times a second
   while scanning, reduces network bandwidth used

-x Don't cross filesystem borders (don't descend into a
   directory which is a mounted disk)

Thanks to Sorin Sbarnea.

share|improve this answer
    
Available under OS X too, via brew. It may be a good idea to call it using ncdu -x -q –  sorin Dec 13 '12 at 12:46
    
awesome! the best option for me was ncdu -q, even in ssh. –  Valter Henrique Apr 19 '13 at 14:36

You probably want xdu.

du -ax | xdu -n

There's also the more sophisticated KDE-based Filelight.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.