3. OS이야기/03. Shell Script

raw device size 확인 스크립트

OSSW(Open Source System SoftWare 2014. 5. 26. 10:48

#!/bin/sh

DISK=`cat /etc/sysconfig/rawdevices | grep -v \# | awk -F /dev/ '{print $3}'`

for i in $DISK

do

SIZE=`cat /proc/partitions | grep $i | awk '{print $3}'`

echo $i $(($SIZE/1024/1024)) GB

done

 

 

-- by 이찬호