当前位置: 技术问答>linux和unix
字节转换
来源: 互联网 发布时间:2016-09-22
本文导语: 我的文件如下:如何换算成G -rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control01.ctl -rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control02.ctl -rw-r----- 1 oracle dba 536871424 Au...
我的文件如下:如何换算成G
-rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control01.ctl
-rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control02.ctl
-rw-r----- 1 oracle dba 536871424 Aug 25 13:47 redo01.log
-rw-r----- 1 oracle dba 536871424 Aug 24 15:33 redo02.log
-rw-r----- 1 oracle dba 536871424 Aug 25 09:00 redo03.log
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb02.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb03.dbf
-rw-r----- 1 oracle dba 4294975488 Aug 25 13:47 sysaux01.dbf
-rw-r----- 1 oracle dba 4294975488 Aug 25 13:47 system01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:36 temp01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:47 undotbs01.dbf
-rw-r----- 1 oracle dba 1073750016 Aug 25 09:05 users01.dbf
文件大小要换算成多少g
-rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control01.ctl
-rw-r----- 1 oracle dba 10764288 Aug 25 13:47 control02.ctl
-rw-r----- 1 oracle dba 536871424 Aug 25 13:47 redo01.log
-rw-r----- 1 oracle dba 536871424 Aug 24 15:33 redo02.log
-rw-r----- 1 oracle dba 536871424 Aug 25 09:00 redo03.log
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb02.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:45 sfedb_tb03.dbf
-rw-r----- 1 oracle dba 4294975488 Aug 25 13:47 sysaux01.dbf
-rw-r----- 1 oracle dba 4294975488 Aug 25 13:47 system01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:36 temp01.dbf
-rw-r----- 1 oracle dba 10737426432 Aug 25 13:47 undotbs01.dbf
-rw-r----- 1 oracle dba 1073750016 Aug 25 09:05 users01.dbf
文件大小要换算成多少g
|
du -gs *
|
讨人厌:
ls -l|awk '{$5=$5/1024/1024/1024;printf "%s %s %s %s %.2fg %s %s %s %sn",$1
,$2,$3,$4,$5,$6,$7,$8,$9}'