I can get Receive and Transmit bytes for an android device as follows
130|sailfish:/ $ cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
rmnet_ipa0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r_rmnet_data7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r_rmnet_data4: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rmnet_data1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rmnet_data3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
wlan0: 6720980481 66560024 0 0 0 0 0 0 355572166 1127583 0 2 0 0 0 0
rmnet_data5: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r_rmnet_data1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Further, I am trying to filter the received and transmit bytes for an Android device using
cat /proc/net/dev |grep wlan | awk {'print $1'}
but I get the following error
/system/bin/sh: awk: not found
Any alternative way to select the appropriate columns?
I tried Perl as well as
cat /proc/net/dev | grep wlan | perl -lane 'print $F[1]'
which gave
/system/bin/sh: perl: not found
using cut as
cat /proc/net/dev | grep wlan | cut -d' ' -f3
gives
6720980481
but the issues is that I want to cut the tab instead of space as I want to select other tabs as well
I tried
cat /proc/net/dev | grep wlan | cut -d'\t' -f3
and
cat /proc/net/dev | grep wlan | cut -d' ' -f3
but it gives
cut: the delimiter must be a single character