403 reputation
47
bio website abhiomkar.in
location India
age 28
visits member for 4 years
seen Nov 25 at 19:26
Python/PHP/JavaScript Ninja

Nov
2
awarded  Popular Question
Oct
29
awarded  Yearling
Jul
24
awarded  Good Answer
Sep
12
awarded  Nice Answer
Sep
12
awarded  Yearling
Jun
26
comment How to get Network Data Received and Data Sent Information on Mac OS X?
I figured it out: here is the one liner to get the Total Data Recieved: echo "`netstat -bi | grep -v Ibytes | grep -v "-" | grep "^en" | awk '{ x += $7 } END { print x / (1024 * 1024 * 1024) }'` + `netstat -bi | grep -v Ibytes | grep -v "-" | grep "^lo" | awk '{ x += $6 } END { print x / (1024 * 1024 * 1024) }'`" | bc
Jun
26
comment How to get Network Data Received and Data Sent Information on Mac OS X?
Thanks :) that worked! I'm using netstat -bi | grep -v Ibytes | grep 'en1' | head -n 1 | awk '{ x = $7 / (1024 * 1024 * 1024) } END { print x }' to get the data received in GB. But, the number is not matching with the one that I'm seeing at System Activity Monitor Network tab (on Mac).
Jun
26
awarded  Supporter
Jun
26
awarded  Scholar
Jun
26
awarded  Critic
Jun
26
accepted How to get Network Data Received and Data Sent Information on Mac OS X?
Jun
25
comment How to get Network Data Received and Data Sent Information on Mac OS X?
@Oneiroi sorry that I didn't mention, I wanted the summary of the number of bytes sent/received. Thanks
Jun
24
asked How to get Network Data Received and Data Sent Information on Mac OS X?
Oct
29
awarded  Necromancer
Dec
30
awarded  Teacher
Dec
29
answered What is the difference between double and single square brackets in bash?
Dec
29
awarded  Autobiographer