
我試圖列出目錄 home 的子目錄的大小,僅列出帶有 pdf 副檔名的檔案。
我嘗試了下一個
ls $home -d /* | xargs du -sb --exclude="!(*.pdf)"
有什麼--include
選擇嗎du
?或者排除選項中的正確模式應該是什麼?
答案1
find ~ -type f -iname "*.pdf" -exec du -sh {} \;
-exec
運行您通過提到的程序{}
,確實您說的find command
是:
du -sh *.pdf
-type
指定文件類型,f
提到regular file
.
並~
提到搜尋的路徑基本路徑。
-iname
提到Incasentisive 搜尋。