如何查看MaxDir

空文件Size=6,文件達(dá)到一定數(shù)量Size變?yōu)?096,更多文件按照4096步進(jìn)

[root@localhost tmp]# mkdir 123
[root@localhost tmp]# stat 123 | grep Size
  Size: 6               Blocks: 0          IO Block: 4096   directory

新建1000個(gè)文件后,Size變?yōu)?096*18

# cat new1000file.py
import os
for i in range(1000):
        os.system('touch 123/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%05d'%i)
# python new1000file.py
# stat 123 | grep Size
  Size: 73728           Blocks: 192        IO Block: 4096   directory

# python -c "print 73728/4096"
18

新建2000個(gè)文件后,Size變?yōu)?096*54

# cat new2000file.py
import os
for i in range(2000):
        os.system('touch 123/yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%05d'%i)
#python new2000file.py
# stat 123 | grep Size
  Size: 221184          Blocks: 536        IO Block: 4096   directory
# python -c "print 221184/4096"
54

復(fù)制一個(gè)100M的文件到目錄123,結(jié)果該Size無變化

# du -sm  /usr/lib/locale/locale-archive
102     /usr/lib/locale/locale-archive

#cp /usr/lib/locale/locale-archive /tmp/123/
#stat 123 | grep Size
  Size: 221184          Blocks: 536        IO Block: 4096   directory

查看文件數(shù)量最多的目錄

[root@localhost /]# find /  -type d -exec stat {} \;|  grep -e "Size\|File" | xargs -l2 | awk -F' ' '{print $4","$2}' | sort --sort=n  -r | head -n 3
25518080,‘/test/111’
24576,‘/usr/share/man/man8’
20480,‘/usr/share/man/man1’
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Ubuntu的發(fā)音 Ubuntu,源于非洲祖魯人和科薩人的語言,發(fā)作 oo-boon-too 的音。了解發(fā)音是有意...
    螢火蟲de夢(mèng)閱讀 100,810評(píng)論 9 468
  • 點(diǎn)擊查看原文 Web SDK 開發(fā)手冊(cè) SDK 概述 網(wǎng)易云信 SDK 為 Web 應(yīng)用提供一個(gè)完善的 IM 系統(tǒng)...
    layjoy閱讀 14,356評(píng)論 0 15
  • 目錄 一、基本命令 1.1 關(guān)機(jī)和重啟 1.2 幫助命令 二、目錄操作命令 2.1 目錄切換 cd 2.2 目錄查...
    一片云天閱讀 342評(píng)論 0 0
  • 一、基本命令 1.1 關(guān)機(jī)和重啟 1.2 幫助命令 二、目錄操作命令 2.1 目錄切換 cd 2.2 目錄查看 l...
    張先森_277b閱讀 486評(píng)論 0 0
  • 一、基本命令 1.1 關(guān)機(jī)和重啟 關(guān)機(jī) shutdown -h now 立刻關(guān)機(jī) shutdown -h 5 ...
    我們來講道理閱讀 556評(píng)論 0 0

友情鏈接更多精彩內(nèi)容