Skip to content

Instantly share code, notes, and snippets.

View cjblocker's full-sized avatar

Cameron Blocker cjblocker

View GitHub Profile
@cjblocker
cjblocker / colored_ducks.sh
Created April 5, 2019 20:09
Print disk usage of all files and directories (ducks) with the colors of ls (for macOS).
#!/bin/bash
# Don't glob . and .. and don't ignore .files
export GLOBIGNORE=".:.."
# Old ducks with no color, sorted ascending with at most the 50 largest
#alias ducks='du -cksh * | sort -h | tail -n 50'
# ducks with color from ls, sorted ascending with at most the 50 largest
alias ducks="paste -d' ' <(du -cksh * | cut -f1) <(CLICOLOR_FORCE=1 ls -1d * && echo total) | sort -h | tail -n 50"