007-df和du的使用

df的使用

[root@Carlton scripts]# df -i    #查看inode信息
Filesystem      Inodes IUsed   IFree IUse% Mounted on
/dev/vda1      2621440 89215 2532225    4% /
tmpfs           127498    23  127475    1% /dev/shm
/dev/vdb1        25792    11   25781    1% /mnt
[root@Carlton scripts]# df -h   #單位爲M的顯示各個區的大小
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G  2.8G   35G   8% /
tmpfs           499M   12M  487M   3% /dev/shm
/dev/vdb1        94M  1.6M   87M   2% /mnt
[root@Carlton scripts]# df -k 
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/vda1       41152832 2887012  36168720   8% /
tmpfs             509992   11388    498604   3% /dev/shm
/dev/vdb1          95425    1550     88736   2% /mnt
[root@Carlton scripts]# df -m
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/vda1          40189  2820     35322   8% /
tmpfs                499    12       487   3% /dev/shm
/dev/vdb1             94     2        87   2% /mnt

如何快速找到一個分區佔用的大文件

[root@Carlton /]# du -sm *
7       bin
53      boot
1       dev
1       download
33      etc
137     home
1       index.html
292     lib
27      lib64
1       lost+found
1       media
1       mnt
1       opt

另外一種顯示方法

[root@Carlton /]# du -sh *   # s 是所有顯示的意思, h 即單位
6.7M    bin
53M     boot
428K    dev
4.0K    download
33M     etc
139M    home
24K     index.html
292M    lib
27M     lib64
16K     lost+found
4.0K    media
13K     mnt
4.0K    opt

若是想詳細瞭解,man 幫助html

相關文章
相關標籤/搜索