현재 폴더 디스크 사용량 확인
현재 폴더의 총 디스크 사용량을 빠르게 확인하는 방법
현재 폴더의 총 디스크 사용량을 확인하고 싶을 때 du 명령어를 쓰면 돼. 하위 폴더 용량은 빼고 딱 현재 폴더 합계만 보려면 max-depth 옵션을 사용하면 됨.
Linux에서:
du -h --max-depth=0 .
--max-depth=0: 현재 폴더의 총합만 표시.-h: 사람이 읽기 쉬운 단위(KB, MB, GB)로 보여줌.
macOS에서:
du -sh -d 0 .
-s: 하위 항목 합계만 표시 (Summary).-h: 사람이 읽기 쉬운 단위로 표시.-d 0: 깊이를 0으로 설정, 현재 폴더 총합만 보여줌.
여기서 배울 것
- `du` 명령어로 디스크 사용량 확인하기
- `--max-depth=0` 또는 `-d 0` 옵션으로 현재 폴더 총합만 보기
- `-s` (Summary)와 `-h` (Human-readable) 옵션 활용법
- Linux와 macOS에서 `du` 명령어 옵션 차이점
원본 파일 보기 (.claude/skills/tn-disk-usage-depth/SKILL.md)
---
name: Check Current Folder Disk Usage
description: This skill should be used when the user asks to check the total disk usage of the current directory or a specific folder, without listing the sizes of subdirectories (e.g., '현재 폴더 용량 확인', '특정 폴더 총 크기').
version: 1.0.0
source: /home/son/prj/resume/backup_notes_260317/notion/Tech Note/disk usage depth 304d7efd824b806e83e7e400db66c68b.md
---
# disk usage depth
du -h [최대 깊이] [탐색 폴더]
du -h —max-depth=0 .
mac에서는
```bash
du -sh -d 0 .
```
- **`s`**: (Summary) 하위 항목의 합계만 표시합니다.
- **`h`**: (Human-readable) 단위를 읽기 편하게(KB, MB, GB) 표시합니다.
- **`d 0`**: (Depth) 깊이를 0으로 설정하여 현재 폴더의 총합만 보여줍니다. (Linux의 `-max-depth=0`과 동일)