DEV Community

Cover image for Time to Clean My Machine with ncdu

Posted on

Time to Clean My Machine with ncdu

2020 is almost over(To be honest, 2020 is one of the hardest years for me). Anyways, before 2021 cleaning my machine can be good.

GitHub logo rofl0r / ncdu

inofficial fork of "NCurses Disk Usage"

ncdu 1.15.1
  ncdu (NCurses Disk Usage) is a curses-based version of
  the well-known 'du', and provides a fast way to see what
  directories are using your disk space

  In order to compile and install ncdu, you need to have
  at least...

  - a POSIX-compliant operating system (Linux, BSD, etc)
  - curses libraries and header files


  The usual:

    ./configure --prefix=/usr
    make install

  If you're building directly from the git repository, make sure you have perl
  (or rather, pod2man), pkg-config and GNU autoconf/automake installed, then
  run 'autoreconf -i', and you're ready to continue with the usual ./configure
  and make route.


  Copyright (c) 2007-2020 Yoran Heling

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,


$ sudo apt-get install ncdu # Ubuntu(Debian)
$ brew install ncdu # with Homebrew
$ sudo port install ncdu # with MacPorts
Enter fullscreen mode Exit fullscreen mode

How to use

There are two easy ways to use ncdu.
One is to move to the directory that you want to know the details and the other is to pass the directory as a parameter.

$ pwd

# way 1 (/Users/koji/Documents/github/TypeScript)
$ cd TypeScript
$ ncdu

# way 2
$ pwd
$ ncdu TypeScript
Enter fullscreen mode Exit fullscreen mode



Then we can move a directory to a directory with the arrow keys

up/down: Select a directory

left: Move out from a directory

right: Move in a directory

We can understand which folders/files are taking space on our machine. The result is really simple and the performance is very good.

Happy Holidays!!!

Top comments (0)