--- /dev/null
+#!/bin/sh
+
+size_human(){
+ local size="$1"
+
+ if [ $size -gt $((1024 * 1024 * 1024)) ]; then
+ size=$((size / 1024 / 1024 / 1024 * 10 + size / 1024 / 1024 % 1024 / 100))
+ printf "%i.%i GB" "$((size / 10))" "$((size % 10))"
+
+ elif [ $size -gt $((1024 * 1024)) ]; then
+ size=$((size / 1024 / 1024 * 10 + size / 1024 % 1024 / 100))
+ printf "%i.%i MB" "$((size / 10))" "$((size % 10))"
+
+ elif [ $size -gt $((1024)) ]; then
+ size=$((size / 1024 * 10 + size % 1024 / 100))
+ printf "%i.%i KB" "$((size / 10))" "$((size % 10))"
+
+ else
+ printf "%i B" "$size"
+ fi
+}