Skip to content
Snippets Groups Projects
user avatar
Ing. Michal Svamberg authored
e5f290d7
History

nccf

instalace zig prostředí

Nedělat na virtálním stroji, pouští se LLVM kompilátor a ten vyžaduje nějaký nevirtualizační procesor.

export PATH=$PATH:/snap/bin
snap install zig --classic --beta
apt install -y make libncurses-dev

build

git clone https://gitlab.cesnet.cz/702/provoz/nccf.git
cd nccf
make
cp zig-out/bin/ncdu /tmp/nccf

Jak použít s exclude

Chci pouze počítat soubory konkrétního uživatele, tzn. vše ostatní se musí excludovat:

find . \! -user nagios | cut -c 3- > /tmp/exclude.txt
nccf . -x -X /tmp/exclude.txt

Uložit a načíst s kompresí

nccf . -x -o - | gzip > /tmp/out.nccf.gz
zcat /tmp/out.nccf.gz | nccf -r -f -

ncdu-zig

Description

Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don't have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.

See the ncdu 2 release announcement for information about the differences between this Zig implementation (2.x) and the C version (1.x).

Requirements

  • Zig 0.10.0 or 0.10.1
  • Some sort of POSIX-like OS
  • ncurses libraries and header files

Install

You can use the Zig build system if you're familiar with that.

There's also a handy Makefile that supports the typical targets, e.g.:

make
sudo make install PREFIX=/usr