如何使用 du 指令取得根內容和巢狀內容以獲得相同的總值?

如何使用 du 指令取得根內容和巢狀內容以獲得相同的總值?

關於du帶有選項的命令-sch

如果執行du -sch spring-security出現:

103M    spring-security
103M    total

但出現了if isexecute du -sch spring-security/*(見底部)

12K     spring-security/CONTRIBUTING.adoc
12K     spring-security/LICENSE.txt
4.0K    spring-security/README.adoc
8.0K    spring-security/RELEASE.adoc
705K    spring-security/acl
17K     spring-security/aspects
1.0K    spring-security/bom
8.0K    spring-security/build.gradle
2.6M    spring-security/buildSrc
269K    spring-security/cas
4.0K    spring-security/class_mapping_from_2.0.x.txt
11M     spring-security/config
3.1M    spring-security/core
473K    spring-security/crypto
13K     spring-security/data
4.0K    spring-security/dependencies
4.6M    spring-security/docs
1.2M    spring-security/etc
61K     spring-security/gradle
1.0K    spring-security/gradle.properties
8.0K    spring-security/gradlew
4.0K    spring-security/gradlew.bat
304K    spring-security/itest
661K    spring-security/ldap
1.0K    spring-security/local-antora-playbook.yml
265K    spring-security/messaging
4.0K    spring-security/notice.txt
4.7M    spring-security/oauth2
125K    spring-security/openid
93K     spring-security/remoting
268K    spring-security/rsocket
1.2M    spring-security/saml2
4.0K    spring-security/scripts
4.0K    spring-security/settings.gradle
137K    spring-security/taglibs
731K    spring-security/test
4.2M    spring-security/web
36M     total

令人困惑的是:

  • 為什麼第二個指令執行時會出現36M,而不是再出現103M?

我嘗試了以防萬一,du -ch --max-depth=15 spring-security/*但再次出現 36M

如何獲得與第一個場景和第二個場景相同的總數?

相關內容