bash 将 rsync --stats 输出转换为 GB?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12511636/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Converting rsync --stats output to GB?
提问by Sandra Schlichting
When using --statswith rsync, you get a report at the bottom of the transfer log.
--stats与 rsync 一起使用时,您会在传输日志的底部看到一个报告。
Number of files: 211009
Number of files transferred: 410
Total file size: 903119614118 bytes
Total transferred file size: 9046197739 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 5864077
File list generation time: 23.204 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 5865513
Total bytes received: 1441
I would like to convert Total file sizeand Total transferred file sizein place to GB, so it becomes
我想转换Total file size并Total transferred file size就地到 GB,所以它变成
Number of files: 211009
Number of files transferred: 410
Total file size: 903 GB
Total transferred file size: 9 GB
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 5864077
File list generation time: 23.204 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 5865513
Total bytes received: 1441
Question
题
How should that be done?
那应该怎么做?
回答by keks
rsync --stats -h /your /paths --and --options
rsync --stats -h /your /paths --and --options
-hstands for human readable.
-h代表人类可读。

