- 论坛徽章:
- 0
|
原帖由 wangfeiyue 于 2008-6-24 13:16 发表 ![]()
常常从网上看到别人说用du来看文件大小。du看到的是占磁盘空间,不是文件自身大小。在windows下的属性对话框中二者区别是很明显的。
Linux下发现三个相关命令:du, stat, ls. 都不尽人意。
ls对于文件(非 ...
預設 du 顯示結果是實際佔用磁碟的空間。若你只是要表面上文件大小總和結果那也可以,du 參數改一下就可以。
man du:
- --apparent-size
- print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it
- may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the
- like
复制代码
測試:
- [root@station-53 ~]# du -h /usr/bin
- 108M /usr/bin
- [root@station-53 ~]#
- [root@station-53 ~]# du --apparent-size -h /usr/bin
- 99M /usr/bin
- [root@station-53 ~]#
复制代码
建議你多看 manpage 有很多您要的資訊。
-- |
|