git-annex/ tips/ yet another simple disk usage like utility

Here's the annex-du script that I use:

# !/bin/sh

git annex find "$@" --include '*' --format='${bytesize}\n' |awk '{ sum += $1; nfiles++; } END { printf "%d files, %.3f MB\n", nfiles, sum/1000000 } '

This one can be slow on a large number of files, but it has an advantage of being able to use all of the filtering available in git annex find. For example, to figure out how much is stored in remote X, do

annex-du --in=X

comment 2
You may want to try my `sizes` tool on Hackage. Just pass `-A` and it will be aware of the annex and report sizes as if no files were annexed. The only downside is that it reports file usage for replicated content multiple times, as if you'd copied the data out of the annex rather than hardlinked all duplicate copies (although, this may be exactly the behavior some people want).
Comment by https://me.yahoo.com/a/2grhJvAC049fJnvALDXek.6MRZMTlg--#eec89 — Tue Jul 22 18:11:47 2025
comment 1

Ah, I just found that git annex info can do the same :) Disregard this.

Comment by https://www.google.com/accounts/o8/id?id=AItOawln3ckqKx0x_xDZMYwa9Q1bn4I06oWjkog — Tue Jul 22 18:11:47 2025
Comments on this page are closed.