[miscellaneous] tips for linux storage

기타 유용한 linux 명령어에 대해 작성합니다.

[ubuntu] 파일, 폴더 용량 확인

1. df

1) 디스크 별 용량 확인

df -h

2. du

1) 특정 디렉토리 용량 확인

du -hs folder

  • -h 옵션은 사람이 읽을 수 있는 형태(mb, gb단위)로 출력해준다.
2) 현재 폴더에 있는 폴더 및 파일 용량 출력

du -hs *

3) 현재 폴더에서 파일 용량이 큰 순서대로 출력

du -h --max-depth=1 | sort -hr

4) 현재 디렉토리에서 상위 10개 폴더의 용량 보기

sudo du -hsx * | sort -rh | head -n 10




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • [miscellaneous] docker usage
  • [miscellaneous] linux bash shell script usage
  • [miscellaneous] pyenv usage
  • [구현] MuJoCo 기초 사용법
  • [miscellaneous] tmux usage