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

Conclusions

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

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
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.

  • FOSSPicks

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

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News