go-coreutils icon indicating copy to clipboard operation
go-coreutils copied to clipboard

implement `du`

Open jbenet opened this issue 10 years ago • 1 comments

this made me sad today

disk_usage() {
    # normalize du across systems
    case $(uname -s) in
        Linux)
            DU="du -sb"
            ;;
        FreeBSD)
            DU="du -s -A -B 1"
            ;;
        Darwin | DragonFly)
            DU="du"
            ;;
    esac
        $DU "$1" | awk "{print \$1}"
}

maybe this project can make a go-du that's the same everywhere :)

jbenet avatar Jul 28 '15 06:07 jbenet

And go-coreutils already prefers the gnu/linux flags/convention.

rht avatar Jul 28 '15 10:07 rht