[Linux]리눅스 하위 폴더 용량 확인 du
리눅스에서 하위 폴더 용량을 확인하는 방법 현재 폴더 또는 하위 폴더의 용량을 확인할 때, du 라는 명령어를 사용합니다.du는 disk usage 의 약자 입니다. 폴더, 파일 용량 확인 du du [option] [폴더]
itworld.gmax8.com
폴더, 파일 용량 확인 du
du [option] [폴더]
옵션
-a : 하위 폴더의 모든 파일, 폴더 기본 정보를 출력
-b : 표시단위를 Byte로 출력
-c : 모든 파일의 사용정보와 합계 출력
-k : 표시단위를 KB로 출력
-h : KB, MB, G 등 보기 쉽게 출력
-s : 총 사용량만 출력
-S : 하위 폴더를 제외한 총 사용량 출력
-x : 현재 파일 시스템의 파일 사용량을 출력
-X [파일명] : 지정한 파일명은 제외
--help : du 명령어 도움말
--version : du 명령어 버전
1. 하위 폴더를 포함한 용량 출력
du
2. 하위 폴더를 포함한 파일, 폴더 용량 출력
du -a
[root@itworld ~]# du -a
0 ./conf/enabled_by_maint/localized-error-pages0 ./conf/enabled_by_maint/charset
0 ./conf/enabled_by_maint/security
0 ./conf/enabled_by_maint/serve-cgi-bin
0 ./conf/enabled_by_maint/other-vhosts-access-log
4 ./conf/enabled_by_maint
8 ./conf
3. Byte 단위로 출력
du -b
[root@itworld ~]# du -b
14272679 ./installer/cdebconf15354655 ./installer
59422 ./apt
4096 ./lxd
772005 ./apache2
4096 ./unattended-upgrades
4510 ./dbconfig-common
4096 ./landscape
84943 ./mysql
4096 ./dist-upgrade
8392704 ./journal/7747ae93251a4fd2876e4308beca15df
2155876352 ./journal/1f0ce0498fdf4014a2ab5851b9341272
2164273152 ./journal
2363121035 .
4. KB 단위로 출력
du -k
[root@itworld ~]# du -k
13944 ./installer/cdebconf15016 ./installer
72 ./apt
4 ./lxd
1092 ./apache2
4 ./unattended-upgrades
8 ./dbconfig-common
4 ./landscape
104 ./mysql
4 ./dist-upgrade
8196 ./journal/7747ae93251a4fd2876e4308beca15df
2105436 ./journal/1f0ce0498fdf4014a2ab5851b9341272
2113636 ./journal
2308388 .
5. 용량 단위 별로 보기 편하게 출력, KB, MB, GB
du -h
[root@itworld ~]# du -h
14M ./installer/cdebconf15M ./installer
72K ./apt
4.0K ./lxd
1.1M ./apache2
4.0K ./unattended-upgrades
8.0K ./dbconfig-common
4.0K ./landscape
104K ./mysql
4.0K ./dist-upgrade
8.1M ./journal/7747ae93251a4fd2876e4308beca15df
2.1G ./journal/1f0ce0498fdf4014a2ab5851b9341272
2.1G ./journal
2.3G .
6. 하위 폴더를 포함한 총 사용량 합계
du -s
'IT > Linux' 카테고리의 다른 글
[Linux] chown 파일, 폴더 소유자 변경 (0) | 2023.02.22 |
---|---|
[Linux] 파일 시스템 계층 구조 (0) | 2023.02.22 |
[Linux] cp 진행률 보여주는 rsync (0) | 2023.02.17 |
[Linux] 프로세스 확인 & 죽이기 ps . kill 명령어 (0) | 2023.01.20 |
[Linux] command terminal 단축키 (0) | 2023.01.20 |