zsh:alias: Make sizes an anonymous function

This way one can easily redirect stderr for both commands (not just
`sort`) and specify a path. The path defaults to the current directory,
but listing each entry by globbing.
This commit is contained in:
2025-09-07 21:09:11 +02:00
parent 708daa10dc
commit 0534ec493e

View File

@@ -128,7 +128,7 @@ fi
# Use a reasonable time format
alias date='env LC_TIME=tk_TM date'
# List human readable sizes in order
alias sizes='du -sch * | sort -h'
alias sizes='() { du -sch ${1:-*} "${@[2,-1]}" | sort -h }'
# Count number of occurrences for every line in stdin
alias count='sort | uniq -c | sort -n'
# Inspired by https://stackoverflow.com/a/54541337