How to take number of bytes transmitted and received from /net/proc/dev
0
votes
1
answer
2031
views
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?
Asked by C. Cristi
(228 rep)
Nov 21, 2018, 06:59 AM
Last activity: Nov 21, 2018, 07:41 AM
Last activity: Nov 21, 2018, 07:41 AM