IT/Linux

[Linux] 리눅스 용량 확인 명령어 모음

착한아줌마 2020. 4. 10. 14:35
반응형

 

 

리눅스에서 용량 확인하는 방법들 모음

 

 

 

 

# fdisk -l

디스크 파티션 확인

[root@localhost work]# fdisk -l

Disk /dev/sda: 64.0 GB, 64023257088 bytes, 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b95aa

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   125044735    61472768   8e  Linux LVM

Disk /dev/mapper/centos-root: 38.0 GB, 37992005632 bytes, 74203136 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 6404 MB, 6404702208 bytes, 12509184 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-home: 18.5 GB, 18547212288 bytes, 36225024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

 

 

 

 

# df -h

마운트 상태와 각각의 용량 확인

[root@localhost work]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 3.8G     0  3.8G   0% /dev
tmpfs                    3.8G     0  3.8G   0% /dev/shm
tmpfs                    3.8G   25M  3.8G   1% /run
tmpfs                    3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/centos-root   36G  3.6G   32G  11% /
/dev/sda1               1014M  162M  853M  16% /boot
/dev/mapper/centos-home   18G   33M   18G   1% /home
tmpfs                    771M     0  771M   0% /run/user/0

 

 

 

 

 

# du -h [디렉토리명]

하위 디렉토리들에 대한 목록을 모두 확인

[root@localhost work]# du -h | more
4.0K    ./215_backup/scripts/acl_test/template/http
4.0K    ./215_backup/scripts/acl_test/template/vrrp
4.0K    ./215_backup/scripts/acl_test/template/icmp
4.0K    ./215_backup/scripts/acl_test/template/httpNat
4.0K    ./215_backup/scripts/acl_test/template/20.20.20.1
4.0K    ./215_backup/scripts/acl_test/template/snmp
4.0K    ./215_backup/scripts/acl_test/template/30.30.30.1
4.0K    ./215_backup/scripts/acl_test/template/syslog
32K     ./215_backup/scripts/acl_test/template
132K    ./215_backup/scripts/acl_test
12K     ./215_backup/scripts/dbscript
24K     ./215_backup/scripts/tech_script/image
20K     ./215_backup/scripts/tech_script/pn
44K     ./215_backup/scripts/tech_script/script
96K     ./215_backup/scripts/tech_script
1.1M    ./215_backup/scripts/reboot/b560_a
4.0K    ./215_backup/scripts/reboot/b560_b
2.3M    ./215_backup/scripts/reboot/h510
20K     ./215_backup/scripts/reboot/b250m
5.8M    ./215_backup/scripts/reboot
24K     ./215_backup/scripts/mirror_speed/utp2utp
16K     ./215_backup/scripts/mirror_speed/utp2sfp

 

 

 

 

# du -s [디렉토리명]

해당 디렉토리 용량

명령어를 입력한 현재 디렉토리만의 용량이다

[root@localhost work]# du -s
975904  .

 

 

 

 

# du -hs [디렉토리명]

해당 디렉토리 및 하위 디렉토리 모두 용량 확인

[root@localhost work]# du -hs
954M    .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'IT > Linux' 카테고리의 다른 글

[Linux] tar명령어  (0) 2020.04.12
[Linux] yum repository 변경  (0) 2020.04.12
nf_conntrack table full dropping packet 로그  (0) 2019.12.27
텔넷 root계정 접속 허용  (0) 2019.08.09
리눅스에서 패스워드 저장에관해  (0) 2019.08.08