Weighing in with Ncdu

Ncdu to Go

Ncdu can also redirect the output to a file for later analysis, as follows:

ncdu /home/Downloads -o Downloads-txtcommand

The following command:

ncdu -1xo- /home/Downloads | gzip >Downloads.gz

dumps the output into an archive format. To view the archive later on, enter:

zcat Downloads.gz | ncdu -f-

To view the unpacked text version, use:

ncdu -f Downloads.txt


Ncdu is a useful tool for analyzing the available disk space and locating and removing the biggest space-wasting files. In addition to the other benefits of working at the command line, Ncdu is faster than its GUI-enabled colleagues. You can also include Ncdu in scripts or run it as a cronjob.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Charly's Column

    I’ve never heard of an admin having to remove disks from a server because of a chronic lack of data, but full disks are part of the daily grind. The du clone ncdu will help slim down your data.

  • gdu, godu, duf

    Three modern tools, gdu, godu, and duf, make the task of checking the utilization level of hard disks easier thanks to fast execution speed and a good graphical implementation.

  • broot

    The broot file manager guarantees clearer, quicker navigation of the directory tree at the command line.

  • FOSSPicks

    Graham checks out VLC 3.0, MenuLibre 2.1.5, Texttop, Flameshot, Chomper, Godot 3.0, and much more!

  • FOSSPicks

    This month Graham checks out OpenRGB, QMPlay2, OctaSine, HiFiBerryOS, Speed Dreams, and much more!

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95