1. #!/bin/bash
    2. while :
    3. do
    4. echo '本地网卡 eth0 流量信息如下: '
    5. ifconfig eth0 | grep "RX pack" | awk '{print $5}'
    6. ifconfig eth0 | grep "TX pack" | awk '{print $5}'
    7. sleep 1
    8. done