How can I use Terminal to monitor a network interfaces total traffic in Mb
Sounds like nettop is what you're looking for. Start it with the help parameter to see the options.
nettop -nc -m route
seems to be the best overall traffic gauge but will need additional scripting to parse the output for you
_delta_t=20
_interface=en1
netstat -i -I ${_interface} -b -w ${_delta_t} |
awk 'BEGIN {
printf ("instantaneous (byte/s)\tcumulated (Mbytes)\nin\tout\t\tin\tout\n")
}{
if ($0 !~ /(input|packets)/) {
# get input & output bytes
inb=$3 ; oub=$6 ;
# accumulate them
cuminb+=$3 ; cumoub+=$6 ;
printf("%8d%8d\t", inb/'${_delta_t}', oub/'${_delta_t}')
printf("%8.3f%8.3f\n", cuminb/1000000, cumoub/1000000)
}
}'