# Du 和 Df 命令说明 ## Du 用于查看目录和文件的大小。 参数解释 | Options | Description | |----------------------|---------------------------------------------------------| | -a, --all | write counts for all files, not just directories | | -h, --human-readable | print sizes in human readable format (e.g., 1K 234M 2G) | | -k | like --block-size=1K | | -m | like --block-size=1M | | -S, --separate-dirs | for directories do not include size of subdirectories | | -s, --summarize | display only a total for each argument | 常见用法 ```bash du -sh ``` ## Df 用于查看磁盘的使用情况。 参数解释 | Options | Description | |-------------------------|------------------------------------------------------| | -a, --all | include pseudo, duplicate, inaccessible file systems | | -h, --human-readable | print sizes in powers of 1024 (e.g., 1023M) | | -t, --type=TYPE | limit listing to file systems of type TYPE | | -T, --print-type | print file system type | | -x, --exclude-type=TYPE | limit listing to file systems not of type TYPE | 常见用法 ```bash df -hT df -h -t=ext4 ```