fdisk -l /dev/YOURDEVICE
## Or
fdisk -l /dev/block/YOURDEVICE
## Or
fdisk -l /dev/block/by-name/YOURDEVICEPARTTIONNAME
# Which is my device
df -a # Outputs mount-points
There are four things to watch here.
Sector Size
Start (sector)
End (sector)
Name
# Posix Shell
echo $(( ( Start - End ) * SectorSize ))
# Fish
math "( Start - End ) * SectorSize )"
byte*10^-6=megabyte