Convert between byte count and “human-readable” string

前端 未结 2 1377
天命终不由人
天命终不由人 2021-02-20 00:48

Is there a shell command that simply converts back and forth between a number string in bytes and the \"human-readable\" number string offered by some commands via the -h

2条回答
  •  后悔当初
    2021-02-20 00:53

    numfmt

    To:

    echo "163564736" | numfmt --to=iec
    

    From:

    echo "156M" | numfmt --from=iec
    

提交回复
热议问题