I'm using the following to get human friendly file sizes from the shell.
ls -hl /path/to/file | awk '{print $5}'
It works well in Mac OSX with bash. I'm not sure if its truly portable, or if there is a standard portable way to achieve the same result.