units命令单位转换

1、安装

yum -y install units

 2、转换

[root@ip-172-0-10-9 ~]# units -t "2147483648 bytes" "MB"
2147.4836
[root@ip-172-0-10-9 ~]# units -t "2147483648 bytes" "MiB"
2048
[root@ip-172-0-10-9 ~]# units -t "2147483648 bytes" "GB"
2.1474836
[root@ip-172-0-10-9 ~]# units -t "2147483648 bytes" "GiB"
2

  

原文地址:https://www.cnblogs.com/lemon-le/p/13949855.html