An open API service indexing awesome lists of open source software.

https://github.com/tv42/humanize-bytes

Command-line utilities to convert "MiB" etc to raw numbers, and back
https://github.com/tv42/humanize-bytes

humanize

Last synced: 11 months ago
JSON representation

Command-line utilities to convert "MiB" etc to raw numbers, and back

Awesome Lists containing this project

README

          

humanize-bytes -- Utilities to convert "MiB" etc to raw numbers
===============================================================

Install with

go get github.com/tv42/humanize-bytes/cmd/bytes2human github.com/tv42/humanize-bytes/cmd/human2bytes

Use like this:

$ human2bytes 42GiB
45097156608

$ human2bytes 42GB
42000000000

For example, sort your `du`, but still get readable results:

$ du -b * | sort -nr | head -5 | bytes2human