Quantcast
Channel: A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1 - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 21

Answer by Most Wanted for A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1

$
0
0

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

Viewing all articles
Browse latest Browse all 21

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>