[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: du 太粗糙,怎样获取一个目录下所有文件的总大小?要求精确到字节



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


在 2010年8月12日 上午7:20,User <resation@gmail.com>写道:


du 可以获取一个目录下所有文件的总大小,但只能以 kB, MB, GB 这样的粗
糙结果来显示。而我想精确到字节,有没有其他的工具可以满足我的要求?不能是
GUI 的,要能在终端下运行。



--
To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 20100811232029.GA2778@localhost.localdomain" target="_blank">http://lists.debian.org/[🔎] 20100811232029.GA2778@localhost.localdomain




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

Reply to: