How Can I count the received data from the internet.
I want to run my bash script and count how many MB it receive.
It could be stats for whole system.
watch your network devices
ifconfig ip -s link show cat /proc/net/dev
or better use
iptables whith specific counters, that let you quantize by protocol, kind of connexions, durations, etc...
create a counter rule with no
iptables -A INPUT -i eth0 -p tcp --dport 80
than watch them with
iptables -nvxL INPUT
(for playing with iptable, root access is needed).
You can use pv command, see man pv(1) page. Also you can try different bandwidth monitoring tools.