pip install humanfriendly
and then add a simple function to your default shell (e.g. ~/.bashrc
)
function fsize() { humanfriendly --format-size `stat -f '%z' $1` }
Use like this
➜ fsize file.txt
6.17 KB
pip install humanfriendly
and then add a simple function to your default shell (e.g. ~/.bashrc
)
function fsize() { humanfriendly --format-size `stat -f '%z' $1` }
Use like this
➜ fsize file.txt
6.17 KB