Scroll to navigation

DU(1) 使用者命令 DU(1)

名稱

du - 估計磁碟檔案使用量

概述

du [選項]... [檔案]...
du [OPTION]... --files0-from=F

描述

計算每個檔案的磁碟用量,目錄則取總用量。

必選引數對長短選項同時適用。

-0, --null
使每行輸出以 NUL 字元結束,不新增換行符
輸出所有檔案的磁碟用量,不僅僅是目錄
顯示錶面用量,而並非是磁碟用量;雖然表面用量通常會小一些,但有時它會因為稀疏檔案間的“洞”、內部碎片、非直接引用的塊等原因顯得更大一些。
以指定大小為單位對塊大小進行輸出;例如,'-BM' 以 1,048,576 位元組為單位輸出大小;詳情請參見下方的“SIZE 格式”部分
等效於 '--apparent-size --block-size=1'
顯示總計資訊
只在符號連結顯式在命令列列出時對其進行解引用
僅當目錄(或在 --all 選項啟用時包括檔案)層級不高於命令列引數指定的 N 層時輸出對應目錄或檔案的對應大小;--max-depth=0 等效於 --summarize
統計由檔案 F 給出的由 NUL 空字元結束的檔名列表所對應各個檔案的資訊;如果 F 是 -,則從標準輸入讀取檔名列表
--dereference-args-D)等效
以人類可讀的格式輸出大小(例如,1K 234M 2G)
列出 inode 使用資訊而非塊使用資訊
等效於 --block-size=1K
解引用所有符號連結
如果是硬連線,則重複計算其尺寸
等效於 --block-size=1M
不跟隨任何符號連結(預設行為)
不包括子目錄的佔用量
類似 -h,但使用 1000 的倍數,而非 1024
只分別計算命令列中每個引數所佔的總用量
如果指定大小為正值,排除比該值更小的項,或者在值為負時排除更大的項
顯示目錄中或其子目錄下所有檔案的最後修改時間
顯示指定關鍵字對應的時間而非最後修改時間:atime, access, use, ctime 或 status
使用指定格式顯示時間,格式可以為:full-iso, long-iso, iso 或 +FORMAT;FORMAT 字串以與 'date' 工具類似的方式解讀
排除所有與指定檔案所提供模式匹配的檔案
排除所有與所給模式匹配的檔案
跳過位於不同檔案系統上的目錄
顯示此幫助資訊並退出
顯示版本資訊並退出

Display values are in units of the first available SIZE from --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).

The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on.

PATTERNS

PATTERN is a shell pattern (not a regular expression). The pattern ? matches any one character, whereas * matches any string (composed of zero, one or multiple characters). For example, *.o will match any files whose names end in .o. Therefore, the command

du --exclude='*.o'

will skip all files and subdirectories ending in .o (including the file .o itself).

作者

由 Torbjorn Granlund、David MacKenzie、Paul Eggert 和 Jim Meyering 編寫。

報告錯誤

GNU coreutils 的線上幫助: <https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html> 報告翻譯錯誤。

版權

Copyright © 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

參見

完整文件請見: <https://www.gnu.org/software/coreutils/du>
或者在本地使用: info '(coreutils) du invocation'

本頁面中文版由中文 man 手冊頁計劃提供。
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh

2020年三月 GNU coreutils 8.32