6

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

1
  • I am very afraid that Explorer++ project is no longer active because it has been 5 months without updates
    – Josem
    Aug 8, 2021 at 12:44

3 Answers 3

8

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

2
  • 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 :) Jun 19, 2014 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, 2014 at 17:38
4

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

2
  • It is even better: One can navigate up and down the folder hierarchy (without exiting ncdu), though not higher than the initial folder. Use Enter, arrow keys, and Backspace. Oct 24 at 4:52
  • Though it doesn't update the sizes if files and folders are deleted while it is running. Though pressing 'R' supposedly updates. Oct 24 at 5:05
3

What about nnn? The screenshot on the Github page already shows folder sizes, and the description tells: nnn is also a du analyzer.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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