본문 바로가기

Dev

[Linux] 파일 및 디렉토리(directory) 용량 확인하기

디스크 별 용량 확인이 필요하면

 

df -h

# disk type 확인
df -Th

 

특정 파일 또는 디렉토리 용량 확인이 필요하면

 

du -sh {file or file_path}

 

상황에 맞게 옵션을 변경

 

-s : summarize

-h : human-readable

-c : check more than one directory and see the total

 

현재 디렉토리에서 상위 5개 디렉토리의 용량 보기

 

du -hs * | sort -rh | head -5

 

top 5

 

끝!