4

I am looking for a command line file explorer/manager that displays the folder size. I am aware of GNU Midnight Commander, Last File Manager and vifm but none of them display the folder sizes (edit as corrected in xaizek's answer: they do but you need to hit a keyboard shortcut for each directory). I am also aware of the command du but it's a pain to browse folders and having to du each time.

E.g. Vifm:

enter image description here

E.g. on Windows, using Explorer++, there is an option to automatically display the folder sizes:

enter image description here

enter image description here

7

I would say that the correct answer is "any of the enumerated file managers and ncdu".

I understand that ncdu was actually built to display sizes of directories and it is very convenient if all you want is to free some space, but you can view sizes of directories with file managers too.

Just need to press appropriate shortcut for each directory which size you want to examine or just on their parent directory (except for Last File Manager, which examines current directory rather than selected items):

  • GNU Midnight Commander: Ctrl+Space every time you want size to be calculated (nothing is cached)
  • Last File Manager: # every time you want size to be calculated (nothing is cached)
  • vifm: ga or gA to (re)calculate size (it's cached per directory basis); on recalculation the first command uses cached sizes of directories, while the second command ignores them and traverses whole directory subtrees.

E.g. Vifm:

Vifm with directory sizes

  • 1
    Good point, thanks! I guess I should have added in the question that I want to have the folder size at the same time as I am browsing files/folders without having to hit a shortcut all the time :) – Franck Dernoncourt Jun 19 '14 at 15:55
  • 1
    @FranckDernoncourt, I didn't realize until now that vifm is the only one of these three who actually caches sizes of directories. Edited the answer to include this difference. I know how this works on Windows, that's why it's implemented this way in vifm, I just expected all file managers to cache results like that. Another minor difference is that MC and LFM do calculations in foreground blocking browsing until size calculation is finished. I also must note that ncdu is still better on this, because it recalculates directory sizes automatically after file removal. – xaizek Jun 19 '14 at 17:38
3

You can use ncdu:

  • free and open source: apt-get install ncdu (package available for many other distros)
  • Linux and Mac OS X
  • CLI
  • displays the folder size (it computes the folder size only once when you run ncdu):

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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