29 lines
803 B
Markdown
29 lines
803 B
Markdown
|
---
|
|||
|
icon: edit
|
|||
|
date: 2023-03-15
|
|||
|
category:
|
|||
|
- 系统配置
|
|||
|
- Linux
|
|||
|
headerDepth: 5
|
|||
|
---
|
|||
|
|
|||
|
|
|||
|
# linux 查看磁盘使用情况,查看文件夹及文件大小命令
|
|||
|
##### ```df -h``` 查看磁盘使用情况
|
|||
|
```shell
|
|||
|
df -h
|
|||
|
```
|
|||
|

|
|||
|
|
|||
|
##### ```du -h --max-depth=1``` 列出当前文件夹下 深度为 1 的文件夹大小
|
|||
|
```shell
|
|||
|
du -h --max-depth=1
|
|||
|
```
|
|||
|

|
|||
|
max-depth=1,表示几级子目录,如果不需要子目录,=0 ,即可
|
|||
|
|
|||
|
##### ```du -h “文件名”``` 列出当前文件的大小
|
|||
|
```shell
|
|||
|
du -h “文件名”
|
|||
|
```
|
|||
|

|