diff options
Diffstat (limited to '.functions')
-rw-r--r-- | .functions | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -3,6 +3,20 @@ function mkd() { mkdir -p "$@" && cd "$@" } +# Determine size of a file or total size of a directory +function fs() { + if du -shb /dev/null > /dev/null 2>&1; then + local arg=-sbh + else + local arg=-skh + fi + if [[ -n "$@" ]]; then + du $arg -- "$@" + else + du $arg .[^.]* * + fi +} + # Use Git’s colored diff when available hash git &>/dev/null if [ $? -eq 0 ]; then |