Linux下查看目录大小的du命令

上一篇 / 下一篇  2009-12-04 18:06:09 / 个人分类:Linux

 

Linux下查看目录大小的命令是du,从man中找到几个常用的参数就可以轻松的统计某个文件夹的容量.

  • 1.统计出目录的总大小,并以比较合适的单位表示

-h, --human-readable
             print sizes in human readable format (e.g., 1K 234M 2G)

-s, --summarize
       display only a total for each argument

[blinux@localhost test]$ du -hs /boot
5.7M    /boot

  • 2.当然了,你还可以让结果以单位b、k、m来表示

[blinux@localhost test]$ du -bs /boot
5746310 /boot
[blinux@localhost test]$ du -ks /boot
5772    /boot
[blinux@localhost test]$ du -ms /boot
6       /boot

  • 3.显示目录的总大小及目录树中各文件夹的大小,并以较好的单位表示

[blinux@localhost test]$ du -h /boot
308K    /boot/grub
5.7M    /boot


TAG:

 

评分:0

我来说两句

日历

« 2024-04-19  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 55462
  • 日志数: 96
  • 建立时间: 2009-12-04
  • 更新时间: 2010-05-25

RSS订阅

Open Toolbar