How to get the file size of directories inside a tree on the Linux shell

If your partition consuming so much disk space, but you have no idea where this is coming from? Then I recommend you to use NCDU.

NCDU is a utility that lists all folders including their size in a tree. The utility is written in NCurses. That is why the utility is called: NCurses Disk Usage.

Example:

ncdu 1.15.1 ~ Use the arrow keys to navigate, press ? for help
--- /root/.npm ----------------------------------------------------------------------------------------------------------------------------------------------
                         /..
   82.5 MiB [##########] /registry.npmjs.org
   20.4 MiB [##        ] /chrome-devtools-frontend
   17.2 MiB [##        ] /typescript
   15.8 MiB [#         ] /@angular
    6.8 MiB [          ] /node-sass
    4.4 MiB [          ] /uws
    3.0 MiB [          ] /jpeg-autorotate
    2.2 MiB [          ] /selenium-webdriver
    1.8 MiB [          ] /jpeg-js
    1.7 MiB [          ] /lighthouse
    1.6 MiB [          ] /core-js
    1.5 MiB [          ] /lodash
    1.4 MiB [          ] /@fortawesome
    1.2 MiB [          ] /ajv
    1.2 MiB [          ] /handlebars
  988.0 KiB [          ] /iconv-lite
  968.0 KiB [          ] /rxjs
  924.0 KiB [          ] /swagger-tools
  820.0 KiB [          ] /node-gyp
  808.0 KiB [          ] /source-map
  784.0 KiB [          ] /bootstrap
  780.0 KiB [          ] /@types
  724.0 KiB [          ] /less
  712.0 KiB [          ] /uglify-js
  684.0 KiB [          ] /@angular-devkit
  652.0 KiB [          ] /acorn
  628.0 KiB [          ] /rollup
  612.0 KiB [          ] /prettyjson
  548.0 KiB [          ] /buble
  524.0 KiB [          ] /moment
  512.0 KiB [          ] /axe-core
  508.0 KiB [          ] /cliff
  484.0 KiB [          ] /terser
  476.0 KiB [          ] /socket.io-client
 Total disk usage: 235.8 MiB  Apparent size: 225.0 MiB  Items: 12485
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp