shell_activity_report() {
# TODO: optional concrete number output
# TODO: optional combinations of granularities: hour, weekday, month, year
shell_activity_report() {
# TODO: optional concrete number output
# TODO: optional combinations of granularities: hour, weekday, month, year
-# Top Disk-Using directories
-# TODO: Consider using numfmt instead of awk
+## Top Disk-Using directories
+## TODO: Consider using numfmt instead of awk
+## tdu : path-string -> (size:number * directory:path-string) list
# - %T+ is a GNU extension;
# - gawk is able to split records on \0, while awk cannot.
# - %T+ is a GNU extension;
# - gawk is able to split records on \0, while awk cannot.
| tee >(gawk -v RS='\0' 'END { printf("[INFO] Total found: %d\n", NR); }') \
| sort -z -k 1 -n -r \
| head -n "$(stty size | awk 'NR == 1 {print $1 - 5}')" -z \
| tee >(gawk -v RS='\0' 'END { printf("[INFO] Total found: %d\n", NR); }') \
| sort -z -k 1 -n -r \
| head -n "$(stty size | awk 'NR == 1 {print $1 - 5}')" -z \