python
import os
print sum([os.lstat(i)[6] for i in os.listdir('.')])

在 2010年8月12日 上午7:20,User <[email protected]>写道:

>
>
> du 可以获取一个目录下所有文件的总大小,但只能以 kB, MB, GB 这样的粗
> 糙结果来显示。而我想精确到字节,有没有其他的工具可以满足我的要求?不能是
> GUI 的,要能在终端下运行。
>
>
>
> --
> To UNSUBSCRIBE, email to [email protected]
> with a subject of "unsubscribe". Trouble? Contact
> [email protected]
> Archive:
> http://lists.debian.org/[email protected]
>
>


-- 
无能者无所求,饱食而遨游,泛若不系之舟

回复