I want to take the number of bytes transmitted and received from /proc/net/dev
in this format: num_ofbytesTransmitted,num_ofbytesReceived
.
This was my approach:
cat /net/proc/dev | grep enp0s3 | cut -f5 -d' '
and
cat /net/proc/dev | grep enp0s3 | cut -f48 -d' '
but the problem here is that I can't always use these constants on cut since the numbers can get big and that number has to change... What can I do in these circumstances?
cat
and dogrep enp0s3 /net/proc/dev
instead.