Hey, I changed the script for mac os. Hope it helps someone.
netu() { # [net]work [u]sage: check network usage stats ADDRESS=$(ifconfig en0 | grep inet | grep -v inet6 | cut -d ' ' -f2) TRANSMITTED_BYTES=$(netstat -ib -I en0 | grep $ADDRESS | awk '{print $10}') TRANSMITTED=$(bc <<< "scale=2; $TRANSMITTED_BYTES/1000000") RECEIVED_BYTES=$(netstat -ib -I en0 | grep $ADDRESS | awk '{print $7}') RECEIVED=$(bc <<< "scale=2; $RECEIVED_BYTES/1000000") printf "%s MB\n" "$(tput bold)🔼 TRANSMITTED $(tput sgr0): $TRANSMITTED" printf "%s MB\n" "$(tput bold)🔽 RECEIVED $(tput sgr0): $RECEIVED" }
Looks 👌
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, I changed the script for mac os. Hope it helps someone.
Looks 👌