Get disk size in Linux
Usually, you'll need root , like so: sudo /sbin/fdisk -l | grep -E "^Disk" But you can also use this: printf "%.1f GB\n" $(echo "`cat /sys/block/sd*/size` * 512 / 1000000000" | bc -l)
Work, play, and everything in between