2021-07-06 10:04:58 +08:00
|
|
|
# Du 和 Df 命令说明
|
2020-08-28 21:31:49 +08:00
|
|
|
|
|
|
|
## Du
|
|
|
|
|
2021-12-03 10:47:05 +08:00
|
|
|
用于查看目录和文件的大小。
|
|
|
|
|
2020-08-28 21:31:49 +08:00
|
|
|
参数解释
|
|
|
|
|
2020-12-25 13:52:08 +08:00
|
|
|
| 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 |
|
2020-08-28 21:31:49 +08:00
|
|
|
|
|
|
|
常见用法
|
|
|
|
|
|
|
|
```bash
|
|
|
|
du -sh <folder>
|
|
|
|
```
|
|
|
|
|
|
|
|
## Df
|
|
|
|
|
2021-12-03 10:47:05 +08:00
|
|
|
用于查看磁盘的使用情况。
|
|
|
|
|
2020-12-25 13:52:08 +08:00
|
|
|
参数解释
|
|
|
|
|
|
|
|
| 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 |
|
|
|
|
|
2020-08-28 21:31:49 +08:00
|
|
|
常见用法
|
|
|
|
|
|
|
|
```bash
|
2020-12-25 13:52:08 +08:00
|
|
|
df -hT
|
|
|
|
df -h -t=ext4
|
2020-08-28 21:31:49 +08:00
|
|
|
```
|